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.05 - 0.01 and 0.05 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1472704.54..1472704.55 rows=1 width=8) (actual time=20565.910..20565.910 rows=1 loops=1) Buffers: shared hit=511992 read=519212 written=1498 -> Bitmap Heap Scan on lineitem (cost=192766.13..1468863.52 rows=768203 width=8) (actual time=8232.549..20402.896 rows=762385 loops=1) Recheck Cond: ((l_shipdate >= '1997-01-01'::date) AND (l_shipdate < '1998-01-01'::date)) Filter: ((l_discount >= 0.04::double precision) AND (l_discount <= 0.06::double precision) AND (l_quantity < 24::double precision)) Rows Removed by Filter: 8339915 Heap Blocks: exact=1006331 Buffers: shared hit=511992 read=519212 written=1498 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..192574.08 rows=9200551 width=0) (actual time=7519.801..7519.801 rows=9136808 loops=1) Index Cond: ((l_shipdate >= '1997-01-01'::date) AND (l_shipdate < '1998-01-01'::date)) Buffers: shared hit=1633 read=23240 written=987 Planning time: 2.213 ms Execution time: 20576.836 ms (13 rows) COMMIT; COMMIT