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.09 - 0.01 and 0.09 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1467125.37..1467125.38 rows=1 width=8) (actual time=17052.895..17052.896 rows=1 loops=1) Buffers: shared hit=803353 read=227404 written=74 -> Bitmap Heap Scan on lineitem (cost=191205.04..1465202.83 rows=384508 width=8) (actual time=7196.993..16967.779 rows=380140 loops=1) Recheck Cond: ((l_shipdate >= '1997-01-01'::date) AND (l_shipdate < '1998-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: 8730960 Heap Blocks: exact=1005884 Buffers: shared hit=803353 read=227404 written=74 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..191108.92 rows=9128435 width=0) (actual time=6493.908..6493.908 rows=9129496 loops=1) Index Cond: ((l_shipdate >= '1997-01-01'::date) AND (l_shipdate < '1998-01-01'::date)) Buffers: shared hit=3 read=24870 written=59 Planning time: 1.808 ms Execution time: 17066.447 ms (13 rows) COMMIT; COMMIT