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.03 - 0.01 and 0.03 + 0.01 and l_quantity < 25; QUERY PLAN ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Aggregate (cost=1479545.43..1479545.44 rows=1 width=8) (actual time=23627.262..23627.262 rows=1 loops=1) Buffers: shared hit=343460 read=695454 -> Bitmap Heap Scan on lineitem (cost=191729.32..1475539.22 rows=801241 width=8) (actual time=7848.985..23376.012 rows=792999 loops=1) Recheck Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Filter: ((l_discount >= 0.02::double precision) AND (l_discount <= 0.04::double precision) AND (l_quantity < 25::double precision)) Rows Removed by Filter: 8305558 Buffers: shared hit=343460 read=695454 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..191529.01 rows=9186218 width=0) (actual time=7157.092..7157.092 rows=9199294 loops=1) Index Cond: ((l_shipdate >= '1994-01-01'::date) AND (l_shipdate < '1995-01-01'::date)) Buffers: shared read=24866 Total runtime: 23643.438 ms (11 rows) COMMIT; COMMIT