BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1994-01-01' and l_shipdate < cast(date '1994-01-01' + interval '1 year' as date) and l_discount between 0.08 - 0.01 and 0.08 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1475008.68..1475008.69 rows=1 width=8) (actual time=19343.439..19343.439 rows=1 loops=1) Buffers: shared hit=474793 read=562117 dirtied=1 written=560 -> Bitmap Heap Scan on lineitem (cost=190770.27..1471206.35 rows=760466 width=8) (actual time=5080.917..19170.104 rows=761072 loops=1) Recheck Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Filter: ((l_discount >= 0.07::double precision) AND (l_discount <= 0.09::double precision) AND (l_quantity < 24::double precision)) Rows Removed by Filter: 8346760 Heap Blocks: exact=1012045 Buffers: shared hit=474793 read=562117 dirtied=1 written=560 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..190580.15 rows=9131559 width=0) (actual time=4503.681..4503.681 rows=9181068 loops=1) Index Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Buffers: shared read=24865 written=55 Planning time: 2.041 ms Execution time: 19355.458 ms (13 rows) COMMIT; COMMIT