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.03 - 0.01 and 0.03 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1479326.30..1479326.31 rows=1 width=8) (actual time=31504.305..31504.305 rows=1 loops=1) Buffers: shared hit=256590 read=782196 written=598 -> Bitmap Heap Scan on lineitem (cost=191683.92..1475451.46 rows=774968 width=8) (actual time=8855.610..31191.490 rows=763308 loops=1) Recheck Cond: ((l_shipdate >= '1997-01-01'::date) AND (l_shipdate < '1998-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: 8349345 Buffers: shared hit=256590 read=782196 written=598 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..191490.18 rows=9184335 width=0) (actual time=8189.166..8189.166 rows=9202776 loops=1) Index Cond: ((l_shipdate >= '1997-01-01'::date) AND (l_shipdate < '1998-01-01'::date)) Buffers: shared hit=4 read=24870 written=46 Total runtime: 31511.498 ms (11 rows) COMMIT; COMMIT