EXPLAIN (NODES OFF, COSTS OFF)
SELECT count(*) FROM tenk1
WHERE hundred = 42 AND (thousand = 42 OR thousand = 99);
- QUERY PLAN
-------------------------------------------------------------------
+ QUERY PLAN
+---------------------------------------------------------------------------------------------
Aggregate
-> Remote Subquery Scan on all
-> Aggregate
-> Bitmap Heap Scan on tenk1
- Recheck Cond: (hundred = 42)
- Filter: ((thousand = 42) OR (thousand = 99))
- -> Bitmap Index Scan on tenk1_hundred
- Index Cond: (hundred = 42)
-(8 rows)
+ Recheck Cond: ((hundred = 42) AND ((thousand = 42) OR (thousand = 99)))
+ -> BitmapAnd
+ -> Bitmap Index Scan on tenk1_hundred
+ Index Cond: (hundred = 42)
+ -> BitmapOr
+ -> Bitmap Index Scan on tenk1_thous_tenthous
+ Index Cond: (thousand = 42)
+ -> Bitmap Index Scan on tenk1_thous_tenthous
+ Index Cond: (thousand = 99)
+(13 rows)
SELECT count(*) FROM tenk1
WHERE hundred = 42 AND (thousand = 42 OR thousand = 99);
relname | n_tup_ins | n_tup_upd | n_tup_del | n_live_tup | n_dead_tup
-------------------+-----------+-----------+-----------+------------+------------
trunc_stats_test | 3 | 0 | 0 | 3 | 0
- trunc_stats_test1 | 3 | 0 | 0 | 3 | 0
+ trunc_stats_test1 | 3 | 0 | 1 | 2 | 1
trunc_stats_test2 | 2 | 0 | 0 | 0 | 2
trunc_stats_test3 | 2 | 0 | 0 | 0 | 2
trunc_stats_test4 | 2 | 0 | 0 | 0 | 2