BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1995-01-01' and l_shipdate < cast(date '1995-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=1469505.92..1469505.93 rows=1 width=8) (actual time=17045.151..17045.152 rows=1 loops=1) Buffers: shared hit=434042 read=597454 written=4187 -> Bitmap Heap Scan on lineitem (cost=191260.53..1465704.83 rows=760219 width=8) (actual time=5128.872..16874.051 rows=761107 loops=1) Recheck Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-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: 8345239 Heap Blocks: exact=1006610 Buffers: shared hit=434042 read=597454 written=4187 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..191070.48 rows=9128591 width=0) (actual time=4582.752..4582.752 rows=9140630 loops=1) Index Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-01-01'::date)) Buffers: shared hit=1870 read=23016 written=1181 Planning time: 1.663 ms Execution time: 17049.565 ms (13 rows) COMMIT; COMMIT