Skip site navigation (1) Skip section navigation (2)

Re: Avg performance for int8/numeric

From: Neil Conway <neilc(at)samurai(dot)com>
To: Mark Kirkwood <markir(at)paradise(dot)net(dot)nz>
Cc: PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org>, "eng(at)intranet(dot)greenplum(dot)com" <eng(at)intranet(dot)greenplum(dot)com>
Subject: Re: Avg performance for int8/numeric
Date: 2006-11-24 04:09:25
Message-ID: 1164341365.23622.191.camel@localhost.localdomain (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
On Fri, 2006-11-24 at 11:08 +1300, Mark Kirkwood wrote:
> - Modifies do_numeric_accum to have an extra bool parameter and does not 
> calc sumX2 when it is false.

I think it would be clearer to reorganize this function slightly, and
have only a single branch on "useSumX2". On first glance it isn't
obviously that transdatums[2] is defined (but unchanged) when useSumX2
is false.

> Performance gain is approx 33%

Nice.

> (it is still slower than doing sum/count - possibly due to the
> construct/deconstruct overhead of the numeric transition array).

This would indeed be worth profiling. If it turns out that array
overhead is significant, I wonder if we could use a composite type for
the transition variable instead. That might also make it easier to
represent the "N" value as an int8 rather than a numeric.

-Neil



In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2006-11-24 04:18:12
Subject: Re: Avg performance for int8/numeric
Previous:From: Bruce MomjianDate: 2006-11-24 04:06:05
Subject: Re: Direct I/O issues

pgsql-patches by date

Next:From: Tom LaneDate: 2006-11-24 04:18:12
Subject: Re: Avg performance for int8/numeric
Previous:From: Bruce MomjianDate: 2006-11-24 04:06:05
Subject: Re: Direct I/O issues

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group