BEGIN; BEGIN EXPLAIN (ANALYZE, BUFFERS) select sum(l_extendedprice * l_discount) as revenue from lineitem where l_shipdate >= date '1997-01-01' and l_shipdate < cast(date '1997-01-01' + interval '1 year' as date) and l_discount between 0.08 - 0.01 and 0.08 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1471775.52..1471775.53 rows=1 width=8) (actual time=33525.055..33525.056 rows=1 loops=1) Buffers: shared hit=188033 read=845728 dirtied=447 written=70 -> Bitmap Heap Scan on lineitem (cost=190897.14..1467966.87 rows=761730 width=8) (actual time=8429.191..33168.968 rows=761813 loops=1) Recheck Cond: ((l_shipdate >= '1997-01-01'::date) AND (l_shipdate < '1998-01-01'::date)) Filter: ((l_discount >= 0.07::double precision) AND (l_discount <= 0.09::double precision) AND (l_quantity < 24::double precision)) Rows Removed by Filter: 8349636 Buffers: shared hit=188033 read=845728 dirtied=447 written=70 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..190706.71 rows=9123188 width=0) (actual time=7751.471..7751.471 rows=9156668 loops=1) Index Cond: ((l_shipdate >= '1997-01-01'::date) AND (l_shipdate < '1998-01-01'::date)) Buffers: shared read=24874 written=4 Total runtime: 33534.953 ms (11 rows) COMMIT; COMMIT