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.05 - 0.01 and 0.05 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1472220.10..1472220.11 rows=1 width=8) (actual time=21351.252..21351.252 rows=1 loops=1) Buffers: shared hit=885121 read=146959 -> Bitmap Heap Scan on lineitem (cost=192226.92..1468380.12 rows=767996 width=8) (actual time=7816.540..21097.263 rows=763058 loops=1) Recheck Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-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: 8352326 Buffers: shared hit=885121 read=146959 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..192034.92 rows=9177209 width=0) (actual time=7271.323..7271.323 rows=9142993 loops=1) Index Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-01-01'::date)) Buffers: shared hit=17858 read=7029 Total runtime: 21362.502 ms (11 rows) COMMIT; COMMIT