如何解决查询评估计划不懂postgre
一直在关注 YouTube 自定进度学习 Postgresql。禁用索引扫描。 YouTube link
我们应该期望删除 999,999 行,只剩下 1 行。但是查询计划是 Rows Removed by Filter: 333333
删除的这 333333 行是什么意思?
我有根据的猜测是这仅指一位特定的工人。
demo=# explain (verbose,analyze) select count(*) from indexed as i where i.a =42;
QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------
Aggregate (cost=15554.44..15554.45 rows=1 width=8) (actual time=90.376..107.817 rows=1 loops=1)
Output: count(*)
-> Gather (cost=1000.00..15554.43 rows=1 width=0) (actual time=0.544..71.365 rows=1 loops=1)
Workers Planned: 2
Workers Launched: 2
-> Parallel Seq Scan on public.indexed i (cost=0.00..14554.33 rows=1 width=0) (actual time=11.970..29.707 rows=0 loops=3)
Filter: (i.a = 42)
Rows Removed by Filter: 333333
Worker 0: actual time=15.902..15.903 rows=0 loops=1
Worker 1: actual time=19.989..19.989 rows=0 loops=1
Planning Time: 0.175 ms
Execution Time: 107.879 ms
(12 rows)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。