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.09 - 0.01 and 0.09 + 0.01 and l_quantity < 25; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1466019.36..1466019.37 rows=1 width=8) (actual time=28623.022..28623.022 rows=1 loops=1) Buffers: shared hit=606570 read=422340 written=23433 -> Bitmap Heap Scan on lineitem (cost=191767.58..1464010.26 rows=401821 width=8) (actual time=9124.045..28430.391 rows=396716 loops=1) Recheck Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Filter: ((l_discount >= 0.08::double precision) AND (l_discount <= 0.1::double precision) AND (l_quantity < 25::double precision)) Rows Removed by Filter: 8702229 Buffers: shared hit=606570 read=422340 written=23433 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..191667.13 rows=9145230 width=0) (actual time=8390.535..8390.535 rows=9108222 loops=1) Index Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Buffers: shared hit=76 read=24790 Total runtime: 28644.656 ms (11 rows) COMMIT; COMMIT