我有这个查询:
EXPLAIN (ANALYZE, BUFFERS)
SELECT * FROM test
WHERE
timestamp_range @> '2015-01-22 23:00:00'::timestamp
AND data_int_array @> '{49, 61}'::integer[];
Run Code Online (Sandbox Code Playgroud)
哪些输出:
Bitmap Heap Scan on test (cost=16.74..20.75 rows=1 width=113) (actual time=0.364..0.367 rows=2 loops=1)
Recheck Cond: ((timestamp_range @> '2015-01-22 23:00:00'::timestamp without time zone) AND (data_int_array @> '{49,61}'::integer[]))
Heap Blocks: exact=1
Buffers: shared hit=8
-> BitmapAnd (cost=16.74..16.74 rows=1 width=0) (actual time=0.351..0.351 rows=0 loops=1)
Buffers: shared hit=7
-> Bitmap Index Scan on ix_test_interval (cost=0.00..4.40 rows=17 width=0) (actual time=0.130..0.130 rows=12 loops=1)
Index Cond: (timestamp_range @> '2015-01-22 …Run Code Online (Sandbox Code Playgroud)