当前位置:网站首页>Huawei cloud experts explain the new features of gaussdb (for MySQL)
Huawei cloud experts explain the new features of gaussdb (for MySQL)
2022-07-01 18:53:00 【InfoQ】

- Query cache For a single query , Any one of the tables has been modified , If the result set is affected, it needs to be refreshed or invalidated .
- Query cache It depends on the isolation level , Different isolation levels produce different result sets .
- Query cache All data needs to be cached , If the result of the table is large , The cache needs to occupy a large amount of memory or write to disk .

PTRC How to determine the pairing operator and accelerate ?
PTRC How it works ?
SELECT *
FROM t1
WHERE t1.a IN (SELECT a
FROM t2,
t3
WHERE t2.b = t1.b
AND t2. c > t3.d); 
EXPLAIN format=tree
SELECT *
FROM t1
WHERE t1.a IN (SELECT a
FROM t2,
t3
WHERE t2.b = t1.b
AND t2. c > t3.d);-> Filter: <in_optimizer>(t1.a,<exists>(select #2)) (cost=0.35 rows=1)
-> Table scan on t1 (cost=0.35 rows=1)
-> Select #2 (subquery in condition; dependent)
-> Result cache : cache keys(t1.a, t1.b)
-> Limit: 1 row(s) (cost=0.80 rows=1)
-> Filter: (t2.c > t3.d) (cost=0.80 rows=1)
-> Inner hash join (no condition) (cost=0.80 rows=1)
-> Table scan on t3 (cost=0.35 rows=2)
-> Hash
-> Filter: ((t2.b = t1.b) and (<cache>(t1.a) = t2.a)) (cost=0.35 rows=1)
-> Table scan on t2 (cost=0.35 rows=1)
How the optimizer chooses PTRC?
EXPLAIN analyze
SELECT *
FROM t1
WHERE t1.a IN (SELECT a
FROM t2,
t3
WHERE t2.b = t1.b
AND t2. c > t3.d);-> Filter: <in_optimizer>(t1.a,<exists>(select #2)) (cost=0.35 rows=1) (actual time=3800.595..3800.595 rows=0 loops=1)
-> Table scan on t1 (cost=0.35 rows=1) (actual time=0.064..0.093 rows=1 loops=1)
-> Select #2 (subquery in condition; dependent)
-> Result cache : cache keys(t1.a, t1.b) (Cache Hits: 0, Cache Misses:1, Cache Evictions: 0, Cache Overflows: 0, Memory Usage: 40960 ) (actual time=0.115..0.115 rows=0 loops=1)
-> Limit: 1 row(s) (cost=0.80 rows=1) (actual time=0.094..0.094 rows=0 loops=1)
-> Filter: (t2.c > t3.d) (cost=0.80 rows=1) (actual time=0.093..0.093 rows=0 loops=1)
-> Inner hash join (no condition) (cost=0.80 rows=1) (actual time=0.092..0.092 rows=0 loops=1)
-> Table scan on t3 (cost=0.35 rows=2) (never executed)
-> Hash
-> Filter: ((t2.b = t1.b) and (<cache>(t1.a) = t1.a)) (cost=0.35 rows=1) (actual time=0.039..0.039 rows=0 loops=1)
-> Table scan on t2 (cost=0.35 rows=1) (actual time=0.038..0.038 rows=0 loops=1)- Cache Hits: 0, Indicates that the number of hits is 0
- Cache Misses:1, Indicates that the number of misses is 1
- Cache Evictions: 0, Said the use of LRU Number of records eliminated
- Cache Overflows: 0, Memory overflow The number of times
- Memory Usage: 40960, Indicates the amount of memory used by the current query
How the optimizer limits PTRC Memory usage
PTRC How to configure ?

PTRC Performance testing


边栏推荐
- 6款红黄黑榜摄像头评测:谁最安全?谁画质好?从此让你不再踩雷
- 精耕渠道共谋发展 福昕携手伟仕佳杰开展新产品培训大会
- 如何在自有APP内实现小程序实现连麦直播
- R语言使用epiDisplay包的tableStack函数制作统计汇总表格(基于目标变量分组的描述性统计、假设检验等)、不设置by参数则计算数据框指定数据列范围的基础描述性统计信息
- Weekly recommended short videos: be alert to the confusion between "phenomena" and "problems"
- Image acquisition and playback of coaxpress high speed camera based on pxie interface
- Solution: you can ping others, but others can't ping me
- R语言ggplot2可视化:gganimate创建动态柱状图动画(gif)、在动画中沿给定维度逐步显示柱状图、enter_grow函数和enter_fade函数控制运动内插退出(渐变tweening)
- ACM mm 2022 video understanding challenge video classification track champion autox team technology sharing
- Li Kou daily question - Day 32 -1232 Dotted line
猜你喜欢

实例讲解将Graph Explorer搬上JupyterLab

关于企业中台规划和 IT 架构微服务转型

How to realize the applet in its own app to realize continuous live broadcast

How to find customers for investment attraction in industrial parks

linux下清理系统缓存并释放内存

Weekly recommended short videos: be alert to the confusion between "phenomena" and "problems"

12 data dimensioning processing methods

540. Single element in ordered array / 1684 Count the number of consistent strings

创建您自己的NFT集合并发布一个Web3应用程序来展示它们(介绍)

Leetcode-128 最长连续序列
随机推荐
Leetcode-160 intersecting linked list
Halcon image calibration enables subsequent image processing to become the same as the template image
Lumiprobe非荧光炔烃丨EU(5-乙炔基尿苷)
A wonderful time to buy and sell stocks
微服务大行其道的今天,Service Mesh是怎样一种存在?
OpenAI|视频预训练 (VPT):基于观看未标记的在线视频的行动学习
How to realize the bottom layer of read-write lock in go question bank 16
LeetCode-21合并两个有序链表
The R language uses the tablestack function of epidisplay package to make statistical summary tables (descriptive statistics based on the grouping of target variables, hypothesis testing, etc.). If th
R语言ggplot2可视化:可视化折线图、使用labs函数为折线图添加自定义的Y轴标签信息(customize y axis label)
1. "Create your own NFT collections and publish a Web3 application to show them." what is NFT
Popular science: what does it mean to enter the kernel state?
Lefse analysis
GAMES202作业0-环境搭建过程&解决遇到的问题
创建您自己的NFT集合并发布一个Web3应用程序来展示它们(介绍)
R语言caTools包进行数据划分、scale函数进行数据缩放、class包的knn函数构建K近邻分类器、table函数计算混淆矩阵
用WPF写一款开源方便、快捷的数据库文档查询、生成工具
Force buckle day33
研究了11种实时聊天软件,我发现都具备这些功能…
1380. Lucky number in matrix / 1672 Total assets of the richest customers