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.02 - 0.01 and 0.02 + 0.01 and l_quantity < 25; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1472312.94..1472312.95 rows=1 width=8) (actual time=18345.315..18345.315 rows=1 loops=1) Buffers: shared hit=748308 read=285754 written=6041 -> Bitmap Heap Scan on lineitem (cost=191068.80..1468320.12 rows=798564 width=8) (actual time=5079.153..18147.870 rows=797124 loops=1) Recheck Cond: ((l_shipdate >= '1993-01-01'::date) AND (l_shipdate < '1994-01-01'::date)) Filter: ((l_discount >= 0.01::double precision) AND (l_discount <= 0.03::double precision) AND (l_quantity < 25::double precision)) Rows Removed by Filter: 8322989 Heap Blocks: exact=1009168 Buffers: shared hit=748308 read=285754 written=6041 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..190869.15 rows=9131259 width=0) (actual time=4539.414..4539.414 rows=9164571 loops=1) Index Cond: ((l_shipdate >= '1993-01-01'::date) AND (l_shipdate < '1994-01-01'::date)) Buffers: shared read=24894 written=7 Planning time: 1.847 ms Execution time: 18348.785 ms (13 rows) COMMIT; COMMIT