BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1994-01-01' and l_shipdate < cast(date '1994-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=1480712.11..1480712.12 rows=1 width=8) (actual time=14907.235..14907.235 rows=1 loops=1) Buffers: shared hit=875334 read=165599 written=149 -> Bitmap Heap Scan on lineitem (cost=191226.72..1476862.47 rows=769927 width=8) (actual time=4284.364..14750.793 rows=761045 loops=1) Recheck Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-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: 8346710 Heap Blocks: exact=1016068 Buffers: shared hit=875334 read=165599 written=149 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..191034.23 rows=9172167 width=0) (actual time=3839.250..3839.250 rows=9217485 loops=1) Index Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Buffers: shared hit=2108 read=22757 written=7 Planning time: 1.961 ms Execution time: 14913.357 ms (13 rows) COMMIT; COMMIT