BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1997-01-01' and l_shipdate < cast(date '1997-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=1464827.27..1464827.28 rows=1 width=8) (actual time=33027.374..33027.374 rows=1 loops=1) Buffers: shared hit=640164 read=388582 dirtied=70 written=18774 -> Bitmap Heap Scan on lineitem (cost=190382.14..1461045.09 rows=756437 width=8) (actual time=9771.954..32688.489 rows=761007 loops=1) Recheck Cond: ((l_shipdate >= '1997-01-01'::date) AND (l_shipdate < '1998-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: 8341063 Buffers: shared hit=640164 read=388582 dirtied=70 written=18774 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..190193.03 rows=9075020 width=0) (actual time=8748.037..8748.037 rows=9111460 loops=1) Index Cond: ((l_shipdate >= '1997-01-01'::date) AND (l_shipdate < '1998-01-01'::date)) Buffers: shared hit=58 read=24816 Total runtime: 33050.781 ms (11 rows) COMMIT; COMMIT