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 < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1473665.74..1473665.75 rows=1 width=8) (actual time=19486.911..19486.912 rows=1 loops=1) Buffers: shared hit=804369 read=229693 written=5608 -> Bitmap Heap Scan on lineitem (cost=191790.48..1469828.05 rows=767538 width=8) (actual time=4547.228..19248.159 rows=763146 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 < 24::double precision)) Rows Removed by Filter: 8347668 Heap Blocks: exact=1009168 Buffers: shared hit=804369 read=229693 written=5608 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..191598.60 rows=9166203 width=0) (actual time=3788.394..3788.394 rows=9164571 loops=1) Index Cond: ((l_shipdate >= '1993-01-01'::date) AND (l_shipdate < '1994-01-01'::date)) Buffers: shared read=24894 Planning time: 2.596 ms Execution time: 19492.701 ms (13 rows) COMMIT; COMMIT