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


边栏推荐
- Lumiprobe biomolecular quantification - qudye Protein Quantification Kit
- Go语言自学系列 | go语言数据类型
- 解决方案:可以ping别人,但是别人不能ping我
- R语言使用epiDisplay包的aggregate函数将数值变量基于因子变量拆分为不同的子集,计算每个子集的汇总统计信息
- Leetcode-128 最长连续序列
- R语言使用epiDisplay包的dotplot函数通过点图的形式可视化不同区间数据点的频率、使用pch参数自定义指定点图数据点的形状
- Halcon图片标定,使得后续图片处理过后变成与模板图片一样
- ES6数组方法find()、findIndex()的总结「建议收藏」
- R语言epiDisplay包ordinal.or.display函数获取有序logistic回归模型的汇总统计信息(变量对应的优势比及其置信区间、以及假设检验的p值)、write.csv函数保存csv
- Qt中的QFile读写文件操作
猜你喜欢
1380. Lucky number in matrix / 1672 Total assets of the richest customers
透过华为军团看科技之变(六):智慧公路
Find all missing numbers in the array
实例讲解将Graph Explorer搬上JupyterLab
磁盘的基本知识和基本命令
【AGC】如何解决事件分析数据本地和AGC面板中显示不一致的问题?
Why do independent website sellers start to do social media marketing? The original customer conversion rate can be improved so much!
毕业季 | 华为专家亲授面试秘诀:如何拿到大厂高薪offer?
GAMES202作业0-环境搭建过程&解决遇到的问题
隐私沙盒终于要来了
随机推荐
Livedata postvalue will "lose" data
字节跳动数据平台技术揭秘:基于 ClickHouse 的复杂查询实现与优化
Reading notes series "modern methods of C language programming" -- Chapter 2
R language ggplot2 visualization: gganimate creates a dynamic histogram animation (GIF), and displays the histogram and enter step by step along a given dimension in the animation_ Growth function and
Case study on comprehensive competitiveness of principal components
Regular expression
R语言使用epiDisplay包的tableStack函数制作统计汇总表格(基于目标变量分组的描述性统计、假设检验等)、不设置by参数则计算数据框指定数据列范围的基础描述性统计信息
微服务大行其道的今天,Service Mesh是怎样一种存在?
Leetcode-128 最长连续序列
Sum of three numbers
Li Kou daily question - Day 32 -589 N × Preorder traversal of tree
R语言ggplot2可视化:可视化折线图、使用labs函数为折线图添加自定义的Y轴标签信息(customize y axis label)
2. Create your own NFT collections and publish a Web3 application to show them start and run your local environment
关于企业中台规划和 IT 架构微服务转型
Leetcode203 移除链表元素
创建您自己的NFT集合并发布一个Web3应用程序来展示它们(介绍)
Usage and underlying implementation principle of PriorityQueue
R language uses the DOTPLOT function of epidisplay package to visualize the frequency of data points in different intervals in the form of point graph, and uses PCH parameters to customize the shape o
Viewing the whole ecology of Tiktok from a macro perspective
力扣每日一题-第32天-589.N×树的前序遍历