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.05 - 0.01 and 0.05 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1481004.69..1481004.70 rows=1 width=8) (actual time=24197.679..24197.679 rows=1 loops=1) Buffers: shared hit=713515 read=324736 dirtied=956 written=191 -> Bitmap Heap Scan on lineitem (cost=193059.84..1477130.24 rows=774890 width=8) (actual time=8375.823..23903.246 rows=763607 loops=1) Recheck Cond: ((l_shipdate >= '1996-01-01'::date) AND (l_shipdate < '1997-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: 8368692 Buffers: shared hit=713515 read=324736 dirtied=956 written=191 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..192866.12 rows=9245529 width=0) (actual time=7703.470..7703.470 rows=9214061 loops=1) Index Cond: ((l_shipdate >= '1996-01-01'::date) AND (l_shipdate < '1997-01-01'::date)) Buffers: shared hit=6077 read=18856 Total runtime: 24205.797 ms (11 rows) COMMIT; COMMIT