BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1993-01-01' and l_shipdate < cast(date '1993-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=1469420.49..1469420.50 rows=1 width=8) (actual time=16837.050..16837.050 rows=1 loops=1) Buffers: shared hit=142615 read=887447 written=115 -> Bitmap Heap Scan on lineitem (cost=191916.17..1465396.59 rows=804779 width=8) (actual time=5404.357..16675.498 rows=796476 loops=1) Recheck Cond: ((l_shipdate >= '1993-01-01'::date) AND (l_shipdate < '1994-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: 8322844 Heap Blocks: exact=1005168 Buffers: shared hit=142615 read=887447 written=115 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..191714.98 rows=9152641 width=0) (actual time=4878.857..4878.857 rows=9128027 loops=1) Index Cond: ((l_shipdate >= '1993-01-01'::date) AND (l_shipdate < '1994-01-01'::date)) Buffers: shared read=24894 Planning time: 1.613 ms Execution time: 16841.546 ms (13 rows) COMMIT; COMMIT