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.07 - 0.01 and 0.07 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1470062.87..1470062.88 rows=1 width=8) (actual time=27342.295..27342.295 rows=1 loops=1) Buffers: shared hit=637982 read=395108 -> Bitmap Heap Scan on lineitem (cost=190638.47..1466267.70 rows=759034 width=8) (actual time=7367.865..27031.533 rows=761857 loops=1) Recheck Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-01-01'::date)) Filter: ((l_discount >= 0.06::double precision) AND (l_discount <= 0.08::double precision) AND (l_quantity < 24::double precision)) Rows Removed by Filter: 8353386 Buffers: shared hit=637982 read=395108 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..190448.71 rows=9106188 width=0) (actual time=6733.921..6733.921 rows=9151916 loops=1) Index Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-01-01'::date)) Buffers: shared hit=24887 Total runtime: 27353.004 ms (11 rows) COMMIT; COMMIT