gpt4 book ai didi

sql - 如何读取PostgreSQL EXPLAIN, order : top down or bottom up?

转载 作者:行者123 更新时间:2023-11-29 12:29:27 26 4
gpt4 key购买 nike

这是关于 explain.depesz.com 的示例计划:

Limit  (cost=65301.950..65301.950 rows=1 width=219) (actual time=886.074..886.074 rows=0 loops=1)
-> Sort (cost=65258.840..65301.950 rows=17243 width=219) (actual time=879.683..885.211 rows=17589 loops=1)
Sort Key: juliet.romeo
Sort Method: external merge Disk: 4664kB
-> Hash Join (cost=30177.210..62214.980 rows=17243 width=219) (actual time=278.986..852.834 rows=17589 loops=1)
Hash Cond: (whiskey_quebec.whiskey_five = juliet.quebec)
-> Bitmap Heap Scan on whiskey_quebec (cost=326.060..21967.630 rows=17243 width=4) (actual time=7.494..65.956 rows=17589 loops=1)
Recheck Cond: (golf = 297)
-> Bitmap Index Scan on kilo (cost=0.000..321.750 rows=17243 width=0) (actual time=4.638..4.638 rows=17589 loops=1)
Index Cond: (golf = 297)
-> Hash (cost=15750.510..15750.510 rows=329651 width=219) (actual time=267.388..267.388 rows=329651 loops=1)
Buckets: 1024 Batches: 128 Memory Usage: 679kB
-> Seq Scan on juliet (cost=0.000..15750.510 rows=329651 width=219) (actual time=0.003..65.704 rows=329651 loops=1)

这些操作以什么顺序执行?自下而上?自上而下?

最佳答案

两个方向都有意义。从上到下是数据请求。从下到上是数据。你看到一棵树——每个节点都有最小的一个 child 。在执行时,节点调用他的子节点 - “向我发送数据”并且此调用递归地重复到叶子 - seq 扫描,索引扫描,设置返回的函数调用,...逐行生成数据 - 将数据发送给父节点.

关于sql - 如何读取PostgreSQL EXPLAIN, order : top down or bottom up?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21792898/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com