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 < 25; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1467310.94..1467310.95 rows=1 width=8) (actual time=19050.563..19050.564 rows=1 loops=1) Buffers: shared hit=755312 read=275874 written=1989 -> Bitmap Heap Scan on lineitem (cost=190291.86..1463328.22 rows=796543 width=8) (actual time=6555.410..18855.530 rows=796384 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 < 25::double precision)) Rows Removed by Filter: 8314157 Heap Blocks: exact=1006292 Buffers: shared hit=755312 read=275874 written=1989 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..190092.73 rows=9080416 width=0) (actual time=5819.476..5819.476 rows=9142098 loops=1) Index Cond: ((l_shipdate >= '1993-01-01'::date) AND (l_shipdate < '1994-01-01'::date)) Buffers: shared hit=2819 read=22075 written=1086 Planning time: 1.741 ms Execution time: 19063.986 ms (13 rows) COMMIT; COMMIT