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.09 - 0.01 and 0.09 + 0.01 and l_quantity < 25; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1479789.68..1479789.69 rows=1 width=8) (actual time=15932.018..15932.018 rows=1 loops=1) Buffers: shared hit=894788 read=146145 dirtied=932 written=5060 -> Bitmap Heap Scan on lineitem (cost=191626.56..1477794.60 rows=399016 width=8) (actual time=4042.067..15818.872 rows=397116 loops=1) Recheck Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Filter: ((l_discount >= 0.08::double precision) AND (l_discount <= 0.1::double precision) AND (l_quantity < 25::double precision)) Rows Removed by Filter: 8710639 Heap Blocks: exact=1016068 Buffers: shared hit=894788 read=146145 dirtied=932 written=5060 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..191526.80 rows=9195824 width=0) (actual time=3578.487..3578.487 rows=9217485 loops=1) Index Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Buffers: shared hit=23517 read=1348 Planning time: 1.946 ms Execution time: 15938.223 ms (13 rows) COMMIT; COMMIT