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=1483419.45..1483419.46 rows=1 width=8) (actual time=17053.159..17053.160 rows=1 loops=1) Buffers: shared hit=787090 read=254018 dirtied=751 written=328 -> Bitmap Heap Scan on lineitem (cost=192439.05..1479376.86 rows=808518 width=8) (actual time=4898.222..16863.977 rows=797189 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: 8324001 Heap Blocks: exact=1016214 Buffers: shared hit=787090 read=254018 dirtied=751 written=328 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..192236.92 rows=9230036 width=0) (actual time=4258.827..4258.827 rows=9228497 loops=1) Index Cond: ((l_shipdate >= '1993-01-01'::date) AND (l_shipdate < '1994-01-01'::date)) Buffers: shared hit=2 read=24892 written=59 Planning time: 1.882 ms Execution time: 17062.539 ms (13 rows) COMMIT; COMMIT