BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1997-01-01' and l_shipdate < cast(date '1997-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=1464583.94..1464583.95 rows=1 width=8) (actual time=15890.147..15890.147 rows=1 loops=1) Buffers: shared hit=356891 read=672866 written=66 -> Bitmap Heap Scan on lineitem (cost=190521.91..1462617.75 rows=393237 width=8) (actual time=3994.015..15778.731 rows=396823 loops=1) Recheck Cond: ((l_shipdate >= '1997-01-01'::date) AND (l_shipdate < '1998-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: 8714515 Heap Blocks: exact=1004884 Buffers: shared hit=356891 read=672866 written=66 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..190423.61 rows=9091104 width=0) (actual time=3509.129..3509.129 rows=9120673 loops=1) Index Cond: ((l_shipdate >= '1997-01-01'::date) AND (l_shipdate < '1998-01-01'::date)) Buffers: shared read=24873 written=65 Planning time: 1.715 ms Execution time: 15904.367 ms (13 rows) COMMIT; COMMIT