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.05 - 0.01 and 0.05 + 0.01 and l_quantity < 25; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1474438.20..1474438.21 rows=1 width=8) (actual time=15965.128..15965.128 rows=1 loops=1) Buffers: shared hit=660505 read=376405 written=237 -> Bitmap Heap Scan on lineitem (cost=190416.40..1470459.40 rows=795760 width=8) (actual time=4821.331..15783.061 rows=793799 loops=1) Recheck Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Filter: ((l_discount >= 0.04::double precision) AND (l_discount <= 0.06::double precision) AND (l_quantity < 25::double precision)) Rows Removed by Filter: 8314033 Heap Blocks: exact=1012045 Buffers: shared hit=660505 read=376405 written=237 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..190217.46 rows=9114089 width=0) (actual time=4248.403..4248.403 rows=9181068 loops=1) Index Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Buffers: shared hit=2 read=24863 written=36 Planning time: 1.588 ms Execution time: 15975.632 ms (13 rows) COMMIT; COMMIT