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.08 - 0.01 and 0.08 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1482871.18..1482871.19 rows=1 width=8) (actual time=19974.106..19974.107 rows=1 loops=1) Buffers: shared hit=415379 read=625718 written=479 -> Bitmap Heap Scan on lineitem (cost=192253.69..1479000.82 rows=774073 width=8) (actual time=5835.338..19802.616 rows=761751 loops=1) Recheck Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-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: 8351955 Heap Blocks: exact=1016211 Buffers: shared hit=415379 read=625718 written=479 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..192060.17 rows=9221561 width=0) (actual time=5272.338..5272.338 rows=9224450 loops=1) Index Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-01-01'::date)) Buffers: shared hit=59 read=24827 written=19 Planning time: 2.082 ms Execution time: 19985.407 ms (13 rows) COMMIT; COMMIT