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.03 - 0.01 and 0.03 + 0.01 and l_quantity < 25; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1489164.62..1489164.63 rows=1 width=8) (actual time=59213.412..59213.412 rows=1 loops=1) Buffers: shared hit=146378 read=896413 -> Bitmap Heap Scan on lineitem (cost=194074.35..1485103.39 rows=812247 width=8) (actual time=10141.757..58791.339 rows=796567 loops=1) Recheck Cond: ((l_shipdate >= '1997-01-01'::date) AND (l_shipdate < '1998-01-01'::date)) Filter: ((l_discount >= 0.02::double precision) AND (l_discount <= 0.04::double precision) AND (l_quantity < 25::double precision)) Rows Removed by Filter: 8316788 Buffers: shared hit=146378 read=896413 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..193871.29 rows=9317646 width=0) (actual time=9533.622..9533.622 rows=9239692 loops=1) Index Cond: ((l_shipdate >= '1997-01-01'::date) AND (l_shipdate < '1998-01-01'::date)) Buffers: shared hit=3 read=24871 Total runtime: 59222.782 ms (11 rows) COMMIT; COMMIT