BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1995-01-01' and l_shipdate < cast(date '1995-01-01' + interval '1 year' as date) and l_discount between 0.03 - 0.01 and 0.03 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1476496.96..1476496.97 rows=1 width=8) (actual time=24621.419..24621.419 rows=1 loops=1) Buffers: shared hit=792447 read=244019 written=1042 -> Bitmap Heap Scan on lineitem (cost=191827.92..1472650.76 rows=769240 width=8) (actual time=8797.892..24346.166 rows=761820 loops=1) Recheck Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-01-01'::date)) Filter: ((l_discount >= 0.02::double precision) AND (l_discount <= 0.04::double precision) AND (l_quantity < 24::double precision)) Rows Removed by Filter: 8343751 Heap Blocks: exact=1011580 Buffers: shared hit=792447 read=244019 written=1042 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..191635.61 rows=9179104 width=0) (actual time=8082.745..8082.745 rows=9187453 loops=1) Index Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-01-01'::date)) Buffers: shared hit=603 read=24283 written=674 Planning time: 3.148 ms Execution time: 24634.687 ms (13 rows) COMMIT; COMMIT