BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1997-01-01' and l_shipdate < cast(date '1997-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=1471190.22..1471190.23 rows=1 width=8) (actual time=18702.767..18702.767 rows=1 loops=1) Buffers: shared hit=467706 read=565064 written=7 -> Bitmap Heap Scan on lineitem (cost=191086.34..1467192.59 rows=799527 width=8) (actual time=5097.942..18505.635 rows=794925 loops=1) Recheck Cond: ((l_shipdate >= '1997-01-01'::date) AND (l_shipdate < '1998-01-01'::date)) Filter: ((l_discount >= 0.06::double precision) AND (l_discount <= 0.08::double precision) AND (l_quantity < 25::double precision)) Rows Removed by Filter: 8316577 Heap Blocks: exact=1007897 Buffers: shared hit=467706 read=565064 written=7 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..190886.46 rows=9127389 width=0) (actual time=4605.682..4605.682 rows=9147731 loops=1) Index Cond: ((l_shipdate >= '1997-01-01'::date) AND (l_shipdate < '1998-01-01'::date)) Buffers: shared read=24873 written=7 Planning time: 3.532 ms Execution time: 18708.803 ms (13 rows) COMMIT; COMMIT