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=1466833.94..1466833.95 rows=1 width=8) (actual time=21181.447..21181.447 rows=1 loops=1) Buffers: shared hit=709524 read=319221 written=11108 -> Bitmap Heap Scan on lineitem (cost=191331.90..1463017.00 rows=763388 width=8) (actual time=7888.244..20975.745 rows=761007 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: 8341063 Heap Blocks: exact=1003872 Buffers: shared hit=709524 read=319221 written=11108 -> Bitmap Index Scan on lineitem_l_shipdate_l_suppkey__idx (cost=0.00..191141.05 rows=9120449 width=0) (actual time=7196.554..7196.554 rows=9111467 loops=1) Index Cond: ((l_shipdate >= '1997-01-01'::date) AND (l_shipdate < '1998-01-01'::date)) Buffers: shared hit=63 read=24810 Planning time: 1.530 ms Execution time: 21186.504 ms (13 rows) COMMIT; COMMIT