BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1996-01-01' and l_shipdate < cast(date '1996-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=1478565.74..1478565.75 rows=1 width=8) (actual time=70275.000..70275.000 rows=1 loops=1) Buffers: shared hit=519536 read=519730 written=146 -> Bitmap Heap Scan on lineitem (cost=191335.54..1474728.46 rows=767456 width=8) (actual time=10007.720..69871.880 rows=764550 loops=1) Recheck Cond: ((l_shipdate >= '1996-01-01'::date) AND (l_shipdate < '1997-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: 8367994 Buffers: shared hit=519536 read=519730 written=146 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..191143.68 rows=9167685 width=0) (actual time=9334.270..9334.270 rows=9223591 loops=1) Index Cond: ((l_shipdate >= '1996-01-01'::date) AND (l_shipdate < '1997-01-01'::date)) Buffers: shared read=24933 Total runtime: 70288.001 ms (11 rows) COMMIT; COMMIT