BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1993-01-01' and l_shipdate < cast(date '1993-01-01' + interval '1 year' as date) and l_discount between 0.06 - 0.01 and 0.06 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1486607.45..1486607.46 rows=1 width=8) (actual time=35578.170..35578.170 rows=1 loops=1) Buffers: shared hit=842194 read=199913 written=11300 -> Bitmap Heap Scan on lineitem (cost=193488.47..1482723.19 rows=776852 width=8) (actual time=10395.702..35232.087 rows=762578 loops=1) Recheck Cond: ((l_shipdate >= '1993-01-01'::date) AND (l_shipdate < '1994-01-01'::date)) Filter: ((l_discount >= 0.05::double precision) AND (l_discount <= 0.07::double precision) AND (l_quantity < 24::double precision)) Rows Removed by Filter: 8348979 Buffers: shared hit=842194 read=199913 written=11300 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..193294.26 rows=9285143 width=0) (actual time=9649.287..9649.287 rows=9237556 loops=1) Index Cond: ((l_shipdate >= '1993-01-01'::date) AND (l_shipdate < '1994-01-01'::date)) Buffers: shared hit=369 read=24526 Total runtime: 35595.001 ms (11 rows) COMMIT; COMMIT