Re: sum(int4)/sum(int2) improvement

From: Atsushi Ogawa <a_ogawa(at)hi-ho(dot)ne(dot)jp>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: sum(int4)/sum(int2) improvement
Date: 2005-09-01 13:56:11
Message-ID: PIEMIKOOMKNIJLLLBCBBOEPDCKAA.a_ogawa@hi-ho.ne.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Tom Lane wrote:
> Atsushi Ogawa <a_ogawa(at)hi-ho(dot)ne(dot)jp> writes:
> > An attached patch uses AggState->aggcontext instead of per-tuple
> > context to allocate the data. As a result, per-tuple context is not
> > used, and the cycles of AllocSetReset is reduced.
>
> Why is this better than the fix already in place?

Because per-tuple context is reset many times. If per-tuple context is
never used, the following codes of AllocSetReset become effective.

/* Nothing to do if context has never contained any data */
if (block == NULL)
return;

--- Atsushi Ogawa

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Peter Eisentraut 2005-09-01 15:30:34 Version number in psql banner
Previous Message Tom Lane 2005-09-01 13:42:10 Re: sum(int4)/sum(int2) improvement