CREATE TABLE
CREATE INDEX
CREATE INDEX
CREATE INDEX
INSERT 0 10000
INSERT 0 3
ANALYZE
QUERY PLAN |
Bitmap Heap Scan on pairs (cost=12.40..22.34 rows=3 width=4) (actual time=0.019..0.020 rows=3 loops=1) |
Recheck Cond: ((key = 'foo'::text) OR (key = 'bar'::text) OR (key = 'baz'::text)) |
Filter: (value > 10) |
Heap Blocks: exact=1 |
-> BitmapOr (cost=12.40..12.40 rows=3 width=0) (actual time=0.011..0.011 rows=0 loops=1) |
-> Bitmap Index Scan on pairs_key_idx (cost=0.00..4.13 rows=1 width=0) (actual time=0.004..0.005 rows=1 loops=1) |
Index Cond: (key = 'foo'::text) |
-> Bitmap Index Scan on pairs_key_idx1 (cost=0.00..4.13 rows=1 width=0) (actual time=0.001..0.001 rows=1 loops=1) |
Index Cond: (key = 'bar'::text) |
-> Bitmap Index Scan on pairs_key_idx2 (cost=0.00..4.13 rows=1 width=0) (actual time=0.001..0.001 rows=1 loops=1) |
Index Cond: (key = 'baz'::text) |
Planning Time: 0.370 ms |
Execution Time: 0.052 ms |
EXPLAIN
QUERY PLAN |
Seq Scan on pairs (cost=0.00..216.55 rows=3 width=4) (actual time=1.626..1.627 rows=3 loops=1) |
Filter: ((value > 10) AND (key = ANY ('{foo,bar,baz}'::text[]))) |
Rows Removed by Filter: 10000 |
Planning Time: 0.062 ms |
Execution Time: 1.635 ms |
EXPLAIN
QUERY PLAN |
Seq Scan on pairs (cost=0.00..216.55 rows=3 width=4) (actual time=1.606..1.606 rows=3 loops=1) |
Filter: ((value > 10) AND (key = ANY ('{foo,bar,baz}'::text[]))) |
Rows Removed by Filter: 10000 |
Planning Time: 0.052 ms |
Execution Time: 1.613 ms |
EXPLAIN
SELECT 3
SELECT 3
SELECT 3