BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1996-01-01' and l_shipdate < cast(date '1996-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=1487451.70..1487451.71 rows=1 width=8) (actual time=27812.702..27812.702 rows=1 loops=1) Buffers: shared hit=437839 read=604470 written=33987 -> Bitmap Heap Scan on lineitem (cost=193811.40..1483382.94 rows=813753 width=8) (actual time=8465.705..27480.447 rows=795087 loops=1) Recheck Cond: ((l_shipdate >= '1996-01-01'::date) AND (l_shipdate < '1997-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: 8328644 Buffers: shared hit=437839 read=604470 written=33987 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..193607.96 rows=9300113 width=0) (actual time=7488.581..7488.581 rows=9254767 loops=1) Index Cond: ((l_shipdate >= '1996-01-01'::date) AND (l_shipdate < '1997-01-01'::date)) Buffers: shared hit=3022 read=21911 written=365 Total runtime: 27825.426 ms (11 rows) COMMIT; COMMIT