BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1995-01-01' and l_shipdate < cast(date '1995-01-01' + interval '1 year' as date) and l_discount between 0.04 - 0.01 and 0.04 + 0.01 and l_quantity < 25; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1462299.76..1462299.77 rows=1 width=8) (actual time=21170.951..21170.951 rows=1 loops=1) Buffers: shared hit=703747 read=325324 written=11128 -> Bitmap Heap Scan on lineitem (cost=189986.33..1460327.42 rows=394469 width=8) (actual time=7900.877..21040.582 rows=398309 loops=1) Recheck Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-01-01'::date)) Filter: ((l_discount >= 0.03::double precision) AND (l_discount <= 0.05::double precision) AND (l_quantity < 25::double precision)) Rows Removed by Filter: 8708393 Heap Blocks: exact=1004185 Buffers: shared hit=703747 read=325324 written=11128 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..189887.72 rows=9060715 width=0) (actual time=7250.495..7250.495 rows=9115846 loops=1) Index Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-01-01'::date)) Buffers: shared hit=65 read=24821 Planning time: 1.342 ms Execution time: 21175.782 ms (13 rows) COMMIT; COMMIT