BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1994-01-01' and l_shipdate < cast(date '1994-01-01' + interval '1 year' as date) and l_discount between 0.08 - 0.01 and 0.08 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1472635.23..1472635.24 rows=1 width=8) (actual time=16863.013..16863.013 rows=1 loops=1) Buffers: shared hit=723932 read=307982 written=119 -> Bitmap Heap Scan on lineitem (cost=192421.02..1468790.52 rows=768943 width=8) (actual time=6245.322..16709.070 rows=761091 loops=1) Recheck Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Filter: ((l_discount >= 0.07::double precision) AND (l_discount <= 0.09::double precision) AND (l_quantity < 24::double precision)) Rows Removed by Filter: 8346861 Heap Blocks: exact=1007049 Buffers: shared hit=723932 read=307982 written=119 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..192228.79 rows=9186822 width=0) (actual time=5629.223..5629.223 rows=9135631 loops=1) Index Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Buffers: shared read=24865 written=33 Planning time: 1.892 ms Execution time: 16871.114 ms (13 rows) COMMIT; COMMIT