Re: sum(int4)/sum(int2) improvement - Mailing list pgsql-patches

From Atsushi Ogawa
Subject Re: sum(int4)/sum(int2) improvement
Date
Msg-id PIEMIKOOMKNIJLLLBCBBOEPDCKAA.a_ogawa@hi-ho.ne.jp
Whole thread Raw
In response to Re: sum(int4)/sum(int2) improvement  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: sum(int4)/sum(int2) improvement  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-patches
Tom Lane wrote:
> Atsushi Ogawa <a_ogawa@hi-ho.ne.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


pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: sum(int4)/sum(int2) improvement
Next
From: Peter Eisentraut
Date:
Subject: Re: prevent encoding conversion recursive error