Tim*_*Tim 7 postgresql sql-execution-plan
从PostgreSQL文档中的示例:
EXPLAIN SELECT * FROM tenk1 WHERE unique1 < 100 AND stringu1 = 'xxx';
QUERY PLAN
------------------------------------------------------------------------------
Bitmap Heap Scan on tenk1 (cost=5.04..229.43 rows=1 width=244)
Recheck Cond: (unique1 < 100)
Filter: (stringu1 = 'xxx'::name)
-> Bitmap Index Scan on tenk1_unique1 (cost=0.00..5.04 rows=101
width=0)
Index Cond: (unique1 < 100)
Run Code Online (Sandbox Code Playgroud)
我纠正了吗
首先对第一个条件的所有行执行位图索引扫描,并且
然后在返回的行上,执行第二个条件的位图堆扫描?
由于位图索引扫描已检查unique1 <100上的索引条件,为什么在Bitmp堆扫描中再次在相同条件下"重新检查条件"?"Recheck Cond"是什么意思?
我不确定我是否理解这篇相关文章https://dba.stackexchange.com/questions/106264/recheck-cond-line-in-query-plans-with-a-bitmap-index-scan
谢谢.
这是对并非总是执行的条件的潜在重新检查。
仅当位图有损(这EXPLAIN (ANALYZE)将表明)时,才执行重新检查。
如果位图索引扫描的work_mem大小不足以包含每个表行包含一位的位图,则该位图索引扫描将变得有损。然后它将降级为每8K页1位。来自此类块的行将必须重新检查。
| 归档时间: |
|
| 查看次数: |
1755 次 |
| 最近记录: |