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.07 - 0.01 and 0.07 + 0.01 and l_quantity < 25; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1471487.76..1471487.77 rows=1 width=8) (actual time=14287.519..14287.520 rows=1 loops=1) Buffers: shared hit=605732 read=427542 dirtied=443 written=9603 -> Bitmap Heap Scan on lineitem (cost=190941.80..1467495.45 rows=798463 width=8) (actual time=4103.427..14117.304 rows=794117 loops=1) Recheck Cond: ((l_shipdate >= '1997-01-01'::date) AND (l_shipdate < '1998-01-01'::date)) Filter: ((l_discount >= 0.06::double precision) AND (l_discount <= 0.08::double precision) AND (l_quantity < 25::double precision)) Rows Removed by Filter: 8308395 Heap Blocks: exact=1008401 Buffers: shared hit=605732 read=427542 dirtied=443 written=9603 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..190742.18 rows=9122962 width=0) (actual time=3606.505..3606.505 rows=9155125 loops=1) Index Cond: ((l_shipdate >= '1997-01-01'::date) AND (l_shipdate < '1998-01-01'::date)) Buffers: shared hit=3841 read=21032 written=2477 Planning time: 1.558 ms Execution time: 14298.822 ms (13 rows) COMMIT; COMMIT