当前位置:网站首页>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


边栏推荐
- 搭建一个通用监控告警平台,架构上需要有哪些设计
- Leetcode-128 最长连续序列
- LiveData postValue会“丢”数据
- Database foundation: select basic query statement
- Write it down once Net travel management background CPU Explosion Analysis
- 12 data dimensioning processing methods
- 磁盘的基本知识和基本命令
- Weekly recommended short videos: be alert to the confusion between "phenomena" and "problems"
- C language learning notes: type definition typedef and declaration external CSDN creation punch in
- 每周推薦短視頻:警惕“現象”與“問題”相互混淆
猜你喜欢
斯坦福、Salesforce|MaskViT:蒙面视觉预训练用于视频预测
Facebook聊单,SaleSmartly有妙招!
11、用户、组和权限(1)
Why do independent website sellers start to do social media marketing? The original customer conversion rate can be improved so much!
How to realize the applet in its own app to realize continuous live broadcast
AI 训练速度突破摩尔定律;宋舒然团队获得RSS 2022最佳论文奖
解决方案:可以ping别人,但是别人不能ping我
搭建一个通用监控告警平台,架构上需要有哪些设计
Livedata postvalue will "lose" data
Leetcode-128 longest continuous sequence
随机推荐
斯坦福、Salesforce|MaskViT:蒙面视觉预训练用于视频预测
Relational database management system of easyclick
540. Single element in ordered array / 1684 Count the number of consistent strings
[Chongqing Guangdong education] basic psychology reference materials of Tianjin Normal University
R language uses the transmute function of dplyr package to calculate the moving window mean value of the specified data column in dataframe data, and uses ggplot2 package to visualize the line graph b
Leetcode-141环形链表
Leetcode-21 combines two ordered linked lists
Introduction to easyclick database
Mise en place d'une plate - forme générale de surveillance et d'alarme, quelles sont les conceptions nécessaires dans l'architecture?
Memo - about C # generating barcode for goods
力扣每日一题-第32天-589.N×树的前序遍历
2020,最新手机号码手机验证正则表达式,持续更新
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
How to change guns for 2D characters
《Go题库·16》读写锁底层是怎么实现的
Three.js学习-相机Camera的基本操作(了解向)
Leetcode-128 longest continuous sequence
ES6数组去重的三个简单办法
太爱速M源码搭建,巅峰小店APP溢价寄卖源码分享
Lumiprobe 生物分子定量丨QuDye 蛋白定量试剂盒