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.08 - 0.01 and 0.08 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1485632.59..1485632.60 rows=1 width=8) (actual time=23766.977..23766.977 rows=1 loops=1) Buffers: shared hit=682525 read=358777 written=161 -> Bitmap Heap Scan on lineitem (cost=193580.21..1481748.34 rows=776850 width=8) (actual time=7623.663..23476.695 rows=761834 loops=1) Recheck Cond: ((l_shipdate >= '1996-01-01'::date) AND (l_shipdate < '1997-01-01'::date)) Filter: ((l_discount >= 0.07::double precision) AND (l_discount <= 0.09::double precision) AND (l_quantity < 24::double precision)) Rows Removed by Filter: 8361753 Buffers: shared hit=682525 read=358777 written=161 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..193386.00 rows=9284717 width=0) (actual time=6920.951..6920.951 rows=9242240 loops=1) Index Cond: ((l_shipdate >= '1996-01-01'::date) AND (l_shipdate < '1997-01-01'::date)) Buffers: shared hit=1 read=24932 written=60 Total runtime: 23776.243 ms (11 rows) COMMIT; COMMIT