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=17443.771..17443.772 rows=1 loops=1) Buffers: shared hit=683371 read=357562 written=4933 -> Bitmap Heap Scan on lineitem (cost=191626.56..1477794.60 rows=399016 width=8) (actual time=4627.759..17328.040 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=683371 read=357562 written=4933 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..191526.80 rows=9195824 width=0) (actual time=4089.557..4089.557 rows=9217485 loops=1) Index Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Buffers: shared read=24865 written=4 Planning time: 1.998 ms Execution time: 17456.519 ms (13 rows) COMMIT; COMMIT