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 < 25; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1479667.25..1479667.26 rows=1 width=8) (actual time=69842.711..69842.712 rows=1 loops=1) Buffers: shared hit=643247 read=396700 written=5963 -> Bitmap Heap Scan on lineitem (cost=191405.44..1475652.67 rows=802917 width=8) (actual time=10298.484..69425.385 rows=795083 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 < 25::double precision)) Rows Removed by Filter: 8328427 Buffers: shared hit=643247 read=396700 written=5963 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..191204.71 rows=9173788 width=0) (actual time=9686.807..9686.807 rows=9231257 loops=1) Index Cond: ((l_shipdate >= '1996-01-01'::date) AND (l_shipdate < '1997-01-01'::date)) Buffers: shared hit=2042 read=22891 written=1256 Total runtime: 69848.906 ms (11 rows) COMMIT; COMMIT