当前位置:网站首页>[PostgreSQL] - explain SQL分析介绍
[PostgreSQL] - explain SQL分析介绍
2022-07-30 12:15:00 【夹胡碰】
一、图形化在线分析工具
二、执行分析语句
EXPLAIN (ANALYZE, COSTS, VERBOSE, BUFFERS, FORMAT JSON)
select * from ...生成分析JSON之后,填入图形化分析页面,进行分析。
三、分析样例
1、走索引 - Index Scan Node
表示先走二级索引,再走一级索引找到数据
finds relevant records based on an Index. Index Scans perform 2 read operations: one to read the index and another to read the actual value from the table.
2、顺序扫描 - Seq Scan Node
finds relevant records by sequentially scanning the input record set. When reading from a table, Seq Scans (unlike Index Scans) perform a single read operation (only the table is read).
3、缓存 - shared
- Hit - 命中
- Read - 读磁盘
- Dirtied - 脏页(脏页包含在Hit中)
4、循环匹配 - Nested Loop
join数据,将两个结果集进行拼接
merges two record sets by looping through every record in the first set and trying to find a match in the second set. All matching records are returned.
遍历模式
索引模式
5、聚合 - Aggregate
group by 操作
groups records together based on a GROUP BY or aggregate function (like sum()).
6、排序 - Sort
order by 操作
sorts a record set based on the specified sort key.
7、数量限制 - limit
returns a specified number of rows from a record set.
8、with as 临时表 - Common table expressions - CTE
performs a sequential scan of Common Table Expression (CTE) query results. Note that results of a CTE are materialized (calculated and temporarily stored). 对公共表表达式(CTE)查询结果执行顺序扫描。注意,CTE的结果是具体化的(计算并临时存储)。
9、其他操作
- WindowAgg
- Subquery Scan
10、其他join模式图解
- Hash Join
- Merge Join
边栏推荐
- 腰部外骨骼机器人线性自抗扰控制器参数优化
- 力扣——15. 三数之和
- Horizontal comparison of 5 commonly used registration centers, whether it is used for interviews or technical selection, is very helpful
- 历时两月,终拿字节跳动offer,算法面试题分享「带答案」
- 13-GuliMall Basics Summary
- 物理服务器与虚拟机:主要区别和相似之处
- 双击Idea图标打不开——解决办法
- 【Kaggle:UW-Madison GI Tract Image Segmentation】肠胃分割比赛:赛后复盘+数据再理解
- unity对象池(学习)
- Beijing, Shanghai and Guangzhou offline events丨The most unmissable technology gatherings at the end of the year are all gathered
猜你喜欢

作业7.29 目录相关函数和文件属性相关函数

概率论得学习和整理6:概率的分布

数据湖(十八):Flink与Iceberg整合SQL API操作

历时两月,终拿字节跳动offer,算法面试题分享「带答案」

打破原则引入SQL,MongoDB到底想要干啥???

PyQt5快速开发与实战 8.4 设置窗口背景 && 8.5 不规则窗口的显示

奇异值分解(SVD)原理与在降维中的应用(附带例题讲解)(纯理论)

常见的云计算安全问题以及如何解决

京东二面痛遭中间件虐杀,30天学透这套中间件小册,挺进阿里

Based on MySQL database, Redis cache, MQ message middleware, ES high availability scheme of search engine parsing
随机推荐
概率论的学习整理3: 概率的相关概念
Program environment and preprocessing (detailed)
Apifox generates interface documentation tutorial and operation steps
常见的云计算安全问题以及如何解决
[BJDCTF2020]Cookie is so stable-1|SSTI injection
PyQt5快速开发与实战 8.2 绘图 && 8.3 QSS的UI美化
What happened when the computer crashed?
什么是驱动程序签名,驱动程序如何获取数字签名?
【语音识别】基于GMM-HMM的语音识别系统
电流电压采集模块DAM-6160
Heshu Group: Make smart cities smarter and make real life better
解码Redis最易被忽视的CPU和内存占用高问题
[BJDCTF2020]Cookie is so stable-1|SSTI注入
崩了,该来的终究躲不掉
别被隐私计算表象骗了 | 量子位智库报告(附下载)
CMake库搜索函数居然不搜索LD_LIBRARY_PATH
概率论的学习和整理7:理解期望和方差还是要回到随机试验本身,期望不是平均值,方差的公式不同情况不同
微信视频号视频如何下载提取?视频号直播回放如何下载?方法很简单!
saltstack学习1入门基础
SCM engineers written questions induction summary