位图扫描bitmap index scan

最近更新时间: 2025-02-18 16:02:00

  • 复制
    复制成功
postgres=# explain select * from t1 where f1 =1  or f1=2;
                                     QUERY PLAN                                     
------------------------------------------------------------------------------------
 Remote Fast Query Execution  (cost=0.00..0.00 rows=0 width=0)
   Node/s: dn001, dn002
   ->  Bitmap Heap Scan on t1  (cost=4.86..8.85 rows=2 width=37)
         Recheck Cond: ((f1 = 1) OR (f1 = 2))
         ->  BitmapOr  (cost=4.86..4.86 rows=2 width=0)
               ->  Bitmap Index Scan on tf_f1_idx  (cost=0.00..2.43 rows=1 width=0)
                     Index Cond: (f1 = 1)
               ->  Bitmap Index Scan on tf_f1_idx  (cost=0.00..2.43 rows=1 width=0)
                     Index Cond: (f1 = 2)
(9 rows)