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.06 - 0.01 and 0.06 + 0.01 and l_quantity < 25; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1470193.67..1470193.68 rows=1 width=8) (actual time=28217.467..28217.467 rows=1 loops=1) Buffers: shared hit=220249 read=811831 -> Bitmap Heap Scan on lineitem (cost=191182.90..1466203.11 rows=798111 width=8) (actual time=8466.796..27893.613 rows=796513 loops=1) Recheck Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-01-01'::date)) Filter: ((l_discount >= 0.05::double precision) AND (l_discount <= 0.07::double precision) AND (l_quantity < 25::double precision)) Rows Removed by Filter: 8318871 Buffers: shared hit=220249 read=811831 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..190983.37 rows=9126854 width=0) (actual time=7794.597..7794.597 rows=9142993 loops=1) Index Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-01-01'::date)) Buffers: shared hit=2 read=24885 Total runtime: 28222.510 ms (11 rows) COMMIT; COMMIT