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.03 - 0.01 and 0.03 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1467086.17..1467086.18 rows=1 width=8) (actual time=14905.897..14905.898 rows=1 loops=1) Buffers: shared hit=263967 read=764943 written=3701 -> Bitmap Heap Scan on lineitem (cost=191454.69..1463266.70 rows=763895 width=8) (actual time=3207.355..14748.516 rows=760518 loops=1) Recheck Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Filter: ((l_discount >= 0.02::double precision) AND (l_discount <= 0.04::double precision) AND (l_quantity < 24::double precision)) Rows Removed by Filter: 8347629 Buffers: shared hit=263967 read=764943 written=3701 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..191263.72 rows=9126089 width=0) (actual time=2854.748..2854.748 rows=9108147 loops=1) Index Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Buffers: shared hit=5 read=24861 written=543 Total runtime: 14908.988 ms (11 rows) COMMIT; COMMIT