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.09 - 0.01 and 0.09 + 0.01 and l_quantity < 25; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1477663.82..1477663.83 rows=1 width=8) (actual time=22367.610..22367.610 rows=1 loops=1) Buffers: shared hit=528760 read=509016 written=783 -> Bitmap Heap Scan on lineitem (cost=192304.73..1475660.64 rows=400636 width=8) (actual time=7906.293..22213.104 rows=396850 loops=1) Recheck Cond: ((l_shipdate >= '1997-01-01'::date) AND (l_shipdate < '1998-01-01'::date)) Filter: ((l_discount >= 0.08::double precision) AND (l_discount <= 0.1::double precision) AND (l_quantity < 25::double precision)) Rows Removed by Filter: 8714988 Buffers: shared hit=528760 read=509016 written=783 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..192204.57 rows=9213774 width=0) (actual time=7231.821..7231.821 rows=9193180 loops=1) Index Cond: ((l_shipdate >= '1997-01-01'::date) AND (l_shipdate < '1998-01-01'::date)) Buffers: shared hit=3 read=24871 written=18 Total runtime: 22380.060 ms (11 rows) COMMIT; COMMIT