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=1474149.86..1474149.87 rows=1 width=8) (actual time=28318.735..28318.735 rows=1 loops=1) Buffers: shared hit=662401 read=371531 written=6 -> Bitmap Heap Scan on lineitem (cost=192847.98..1472112.36 rows=407500 width=8) (actual time=8322.649..28124.856 rows=397092 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: 8710697 Buffers: shared hit=662401 read=371531 written=6 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..192746.11 rows=9220728 width=0) (actual time=7619.847..7619.847 rows=9153942 loops=1) Index Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Buffers: shared hit=4 read=24862 written=6 Total runtime: 28324.972 ms (11 rows) COMMIT; COMMIT