BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1994-01-01' and l_shipdate < cast(date '1994-01-01' + interval '1 year' as date) and l_discount between 0.03 - 0.01 and 0.03 + 0.01 and l_quantity < 25; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1465908.31..1465908.32 rows=1 width=8) (actual time=25674.349..25674.349 rows=1 loops=1) Buffers: shared hit=650746 read=378164 written=24393 -> Bitmap Heap Scan on lineitem (cost=190819.48..1461941.70 rows=793323 width=8) (actual time=7282.211..25363.351 rows=793069 loops=1) Recheck Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Filter: ((l_discount >= 0.02::double precision) AND (l_discount <= 0.04::double precision) AND (l_quantity < 25::double precision)) Rows Removed by Filter: 8305876 Buffers: shared hit=650746 read=378164 written=24393 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..190621.15 rows=9095432 width=0) (actual time=6716.961..6716.961 rows=9108171 loops=1) Index Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Buffers: shared hit=27 read=24839 Total runtime: 25682.412 ms (11 rows) COMMIT; COMMIT