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.03 - 0.01 and 0.03 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1480966.31..1480966.32 rows=1 width=8) (actual time=77648.837..77648.838 rows=1 loops=1) Buffers: shared hit=476156 read=564756 written=4137 -> Bitmap Heap Scan on lineitem (cost=191462.05..1477122.91 rows=768680 width=8) (actual time=9854.706..77223.495 rows=761639 loops=1) Recheck Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-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: 8342890 Buffers: shared hit=476156 read=564756 written=4137 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..191269.88 rows=9182305 width=0) (actual time=9198.994..9198.994 rows=9223946 loops=1) Index Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-01-01'::date)) Buffers: shared hit=1872 read=23015 written=1574 Total runtime: 77655.732 ms (11 rows) COMMIT; COMMIT