BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1995-01-01' and l_shipdate < cast(date '1995-01-01' + interval '1 year' as date) and l_discount between 0.09 - 0.01 and 0.09 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1462221.61..1462221.62 rows=1 width=8) (actual time=13856.512..13856.513 rows=1 loops=1) Buffers: shared hit=609131 read=419940 dirtied=494 -> Bitmap Heap Scan on lineitem (cost=189982.61..1460323.70 rows=379582 width=8) (actual time=3120.063..13772.001 rows=380168 loops=1) Recheck Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-01-01'::date)) Filter: ((l_discount >= 0.08::double precision) AND (l_discount <= 0.1::double precision) AND (l_quantity < 24::double precision)) Rows Removed by Filter: 8735618 Heap Blocks: exact=1004185 Buffers: shared hit=609131 read=419940 dirtied=494 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..189887.72 rows=9060715 width=0) (actual time=2762.781..2762.781 rows=9115786 loops=1) Index Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-01-01'::date)) Buffers: shared read=24886 Planning time: 3.200 ms Execution time: 13860.081 ms (13 rows) COMMIT; COMMIT