Re: Avg performance for int8/numeric - Mailing list pgsql-patches

From Bruce Momjian
Subject Re: Avg performance for int8/numeric
Date
Msg-id 200702170056.l1H0u1D18396@momjian.us
Whole thread Raw
In response to Re: Avg performance for int8/numeric  (Mark Kirkwood <markir@paradise.net.nz>)
List pgsql-patches
Patch applied.  Thanks.

---------------------------------------------------------------------------


Mark Kirkwood wrote:
> Bruce Momjian wrote:
> > I have tested this patch but it generates regression failures.
> >
> > There was some code drift, so I am attaching an updated version of the
> > patch, and the regression diffs.  The 'four' column is an 'int4' so my
> > guess is that somehow the wrong aggregate is being called.
> >
>
> Good catch - I must have neglected to run the regression test after
> amending the number of array arguments for the numeric avg :-(.
>
> Hmmm - this changing the number of array args for avg means we can't mix
> transition functions for variance with final functions for avg - which
> is exactly what the regression suite does with the 'newavg' aggregate.
>
> I've 'fixed' this by amending the definition of 'newavg' to use the
> transition and final function that 'avg' does. However I found myself
> asking if this lost us the point of that test - so I looked back at the
> older postgres versions (e.g. 7.1.3) and saw that back *then* 'newavg'
> and 'avg' were defined using the same functions...so I think making the
> change as indicated is ok.
>
> I've attached a new patch with this change.
>
> Cheers
>
> Mark


--
  Bruce Momjian  <bruce@momjian.us>          http://momjian.us
  EnterpriseDB                               http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

pgsql-patches by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: [GENERAL] ISO week dates
Next
From: Bruce Momjian
Date:
Subject: Re: \prompt for psql