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.02 - 0.01 and 0.02 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1469712.73..1469712.74 rows=1 width=8) (actual time=50138.082..50138.082 rows=1 loops=1) Buffers: shared hit=717613 read=311423 written=10816 -> Bitmap Heap Scan on lineitem (cost=192709.14..1465864.42 rows=769663 width=8) (actual time=9619.963..49789.206 rows=763022 loops=1) Recheck Cond: ((l_shipdate >= '1993-01-01'::date) AND (l_shipdate < '1994-01-01'::date)) Filter: ((l_discount >= 0.01::double precision) AND (l_discount <= 0.03::double precision) AND (l_quantity < 24::double precision)) Rows Removed by Filter: 8347045 Buffers: shared hit=717613 read=311423 written=10816 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..192516.73 rows=9185790 width=0) (actual time=8931.237..8931.237 rows=9118932 loops=1) Index Cond: ((l_shipdate >= '1993-01-01'::date) AND (l_shipdate < '1994-01-01'::date)) Buffers: shared hit=159 read=24736 Total runtime: 50143.726 ms (11 rows) COMMIT; COMMIT