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=1467706.32..1467706.33 rows=1 width=8) (actual time=32178.203..32178.204 rows=1 loops=1) Buffers: shared hit=597280 read=433479 dirtied=31 written=19689 -> Bitmap Heap Scan on lineitem (cost=190625.76..1463894.52 rows=762360 width=8) (actual time=9258.606..31822.158 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 Buffers: shared hit=597280 read=433479 dirtied=31 written=19689 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..190435.17 rows=9096034 width=0) (actual time=8558.462..8558.462 rows=9132096 loops=1) Index Cond: ((l_shipdate >= '1997-01-01'::date) AND (l_shipdate < '1998-01-01'::date)) Buffers: shared hit=2229 read=22645 written=476 Total runtime: 32195.100 ms (11 rows) COMMIT; COMMIT