Tom Lane wrote:
> I went back and looked at your AllocSetReset patch from last May, and
> liked it better on second consideration.

> I'll fix up the old patch and apply it.  I think that's a better answer
> than kluging up the aggregate functions themselves.

Thanks. I also think this fix is better. It speeds up hash join etc. besides
sum(int4) and sum(int2).

Example:
- SQL
select b.bid, count(*)
from accounts a, branches b
where a.bid = b.bid
group by b.bid;

- Query Plan
HashAggregate  (cost=23198.06..23198.08 rows=5 width=4)
  ->  Hash Join  (cost=1.06..20698.06 rows=500000 width=4)
        Hash Cond: ("outer".bid = "inner".bid)
        ->  Seq Scan on accounts a  (cost=0.00..13197.00 rows=500000
width=4)
        ->  Hash  (cost=1.05..1.05 rows=5 width=4)
              ->  Seq Scan on branches b  (cost=0.00..1.05 rows=5 width=4)

- Result
 original: 2.416s
 patched:  2.286s

regards,

--- Atsushi Ogawa


---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Reply via email to