暂无图片
pg中执行计划顺序解读疑问??
我来答
分享
暂无图片 匿名用户
pg中执行计划顺序解读疑问??

demo=# explain (analyze , buffers) select * from student s , teacher t ;
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------
Nested Loop (cost=0.00..9714.75 rows=774000 width=128) (actual time=0.014..0.020 rows=16 loops=1)
Buffers: shared hit=2
-> Seq Scan on teacher t (cost=0.00..19.00 rows=900 width=62) (actual time=0.007..0.007 rows=4 loops=1)
Buffers: shared hit=1
-> Materialize (cost=0.00..22.90 rows=860 width=66) (actual time=0.001..0.002 rows=4 loops=4)
Buffers: shared hit=1
-> Seq Scan on student s (cost=0.00..18.60 rows=860 width=66) (actual time=0.002..0.003 rows=4 loops=1)
Buffers: shared hit=1

按照从上到下顺序的话,Seq Scan on teacher t 和Materialize 是平行的,就是先执行Seq Scan on teacher t

要按照先里后外或者从右到左,得先执行Seq Scan on student s ,

所以感觉挺矛盾的,到底如何正确理解呢??请高手指点

我来答
添加附件
收藏
分享
问题补充
1条回答
默认
最新
布衣
暂无图片

同级:先上到下
不同级:从右到左
这样就不矛盾了

暂无图片 评论
暂无图片 有用 0
张sir
2022-11-08
李宏达
2022-11-09
愤怒的蜗牛
2022-11-09
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏