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.08 - 0.01 and 0.08 + 0.01 and l_quantity < 24; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1481779.89..1481779.90 rows=1 width=8) (actual time=19937.980..19937.980 rows=1 loops=1) Buffers: shared hit=630911 read=408186 -> Bitmap Heap Scan on lineitem (cost=192867.74..1477913.86 rows=773206 width=8) (actual time=7469.146..19712.114 rows=761829 loops=1) Recheck Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-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: 8352307 Buffers: shared hit=630911 read=408186 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..192674.44 rows=9241161 width=0) (actual time=6765.538..6765.538 rows=9206188 loops=1) Index Cond: ((l_shipdate >= '1995-01-01'::date) AND (l_shipdate < '1996-01-01'::date)) Buffers: shared read=24887 Total runtime: 19943.501 ms (11 rows) COMMIT; COMMIT