BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1996-01-01' and l_shipdate < cast(date '1996-01-01' + interval '1 year' as date) and l_discount between 0.07 - 0.01 and 0.07 + 0.01 and l_quantity < 25; QUERY PLAN -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Aggregate (cost=1369228.83..1369228.84 rows=1 width=8) (actual time=29707.569..29707.570 rows=1 loops=1) Buffers: shared hit=543565 read=522956 written=8272 -> Bitmap Heap Scan on lineitem (cost=92167.85..1365236.34 rows=798497 width=8) (actual time=119.945..29436.004 rows=794958 loops=1) Recheck Cond: ((l_shipdate >= '1996-01-01'::date) AND (l_shipdate < '1997-01-01'::date)) Rows Removed by Index Recheck: 50861838 Filter: ((l_discount >= 0.06::double precision) AND (l_discount <= 0.08::double precision) AND (l_quantity < 25::double precision)) Rows Removed by Filter: 8328533 Heap Blocks: lossy=1066473 Buffers: shared hit=543565 read=522956 written=8272 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey_brin_idx (cost=0.00..91968.22 rows=9182022 width=0) (actual time=119.188..119.188 rows=10664960 loops=1) Index Cond: ((l_shipdate >= '1996-01-01'::date) AND (l_shipdate < '1997-01-01'::date)) Buffers: shared hit=48 Planning time: 1.212 ms Execution time: 29707.672 ms (14 rows) COMMIT; COMMIT