BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1995-01-01' and l_shipdate < cast(date '1995-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=1484550.92..1484550.93 rows=1 width=8) (actual time=70541.555..70541.555 rows=1 loops=1) Buffers: shared hit=720421 read=323008 dirtied=193 written=6866 -> Bitmap Heap Scan on lineitem (cost=191697.31..1480522.72 rows=805640 width=8) (actual time=9615.329..70117.956 rows=794166 loops=1) Recheck Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-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: 8310523 Buffers: shared hit=720421 read=323008 dirtied=193 written=6866 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..191495.90 rows=9204907 width=0) (actual time=8914.151..8914.151 rows=9246341 loops=1) Index Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-01-01'::date)) Buffers: shared hit=23360 read=1527 written=75 Total runtime: 70553.012 ms (11 rows) COMMIT; COMMIT