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.06 - 0.01 and 0.06 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1474537.65..1474537.66 rows=1 width=8) (actual time=22806.099..22806.099 rows=1 loops=1) Buffers: shared hit=610231 read=423831 written=5786 -> Bitmap Heap Scan on lineitem (cost=192211.78..1470702.56 rows=767017 width=8) (actual time=7194.208..22583.645 rows=762443 loops=1) Recheck Cond: ((l_shipdate >= '1993-01-01'::date) AND (l_shipdate < '1994-01-01'::date)) Filter: ((l_discount >= 0.05::double precision) AND (l_discount <= 0.07::double precision) AND (l_quantity < 24::double precision)) Rows Removed by Filter: 8348371 Heap Blocks: exact=1009168 Buffers: shared hit=610231 read=423831 written=5786 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..192020.03 rows=9186346 width=0) (actual time=6471.082..6471.082 rows=9165624 loops=1) Index Cond: ((l_shipdate >= '1993-01-01'::date) AND (l_shipdate < '1994-01-01'::date)) Buffers: shared hit=760 read=24134 written=279 Planning time: 2.103 ms Execution time: 22818.714 ms (13 rows) COMMIT; COMMIT