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.09 - 0.01 and 0.09 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1473692.41..1473692.42 rows=1 width=8) (actual time=18395.821..18395.821 rows=1 loops=1) Buffers: shared hit=512710 read=520552 written=12846 -> Bitmap Heap Scan on lineitem (cost=193236.14..1471766.52 rows=385179 width=8) (actual time=5092.797..18288.255 rows=382366 loops=1) Recheck Cond: ((l_shipdate >= '1996-01-01'::date) AND (l_shipdate < '1997-01-01'::date)) Filter: ((l_discount >= 0.08::double precision) AND (l_discount <= 0.1::double precision) AND (l_quantity < 24::double precision)) Rows Removed by Filter: 8741040 Heap Blocks: exact=1008330 Buffers: shared hit=512710 read=520552 written=12846 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..193139.85 rows=9235128 width=0) (actual time=4570.570..4570.570 rows=9168339 loops=1) Index Cond: ((l_shipdate >= '1996-01-01'::date) AND (l_shipdate < '1997-01-01'::date)) Buffers: shared read=24932 Planning time: 2.770 ms Execution time: 18415.140 ms (13 rows) COMMIT; COMMIT