BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1993-01-01' and l_shipdate < cast(date '1993-01-01' + interval '1 year' as date) and l_discount between 0.07 - 0.01 and 0.07 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1467358.02..1467358.03 rows=1 width=8) (actual time=25674.565..25674.565 rows=1 loops=1) Buffers: shared hit=577733 read=451303 written=27064 -> Bitmap Heap Scan on lineitem (cost=191577.00..1463517.86 rows=768032 width=8) (actual time=7213.407..25390.093 rows=763489 loops=1) Recheck Cond: ((l_shipdate >= '1993-01-01'::date) AND (l_shipdate < '1994-01-01'::date)) Filter: ((l_discount >= 0.06::double precision) AND (l_discount <= 0.08::double precision) AND (l_quantity < 24::double precision)) Rows Removed by Filter: 8346578 Buffers: shared hit=577733 read=451303 written=27064 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..191384.99 rows=9131816 width=0) (actual time=6554.834..6554.834 rows=9118802 loops=1) Index Cond: ((l_shipdate >= '1993-01-01'::date) AND (l_shipdate < '1994-01-01'::date)) Buffers: shared hit=29 read=24866 Total runtime: 25680.391 ms (11 rows) COMMIT; COMMIT