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

pgsql: This patch changes int2_avg_accum() and int4_avg_accum() use the

From: neilc(at)svr1(dot)postgresql(dot)org (Neil Conway)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: This patch changes int2_avg_accum() and int4_avg_accum() use the
Date: 2005-04-04 23:50:27
Message-ID: 20050404235027.F22DD53592@svr1.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-committers
Log Message:
-----------
This patch changes int2_avg_accum() and int4_avg_accum() use the nodeAgg
performance hack Tom introduced recently. This means we can avoid
copying the transition array for each input tuple if these functions
are invoked as aggregate transition functions.

To test the performance improvement, I created a 1 million row table
with a single int4 column. Without the patch, SELECT avg(col) FROM
table took about 4.2 seconds (after the data was cached); with the
patch, it took about 3.2 seconds. Naturally, the performance
improvement for a less trivial query (or a table with wider rows)
would be relatively smaller.

Modified Files:
--------------
    pgsql/src/backend/utils/adt:
        numeric.c (r1.81 -> r1.82)
        (http://developer.postgresql.org/cvsweb.cgi/pgsql/src/backend/utils/adt/numeric.c.diff?r1=1.81&r2=1.82)

pgsql-committers by date

Next:From: Tom LaneDate: 2005-04-05 04:47:20
Subject: pgsql: Fix broken markup.
Previous:From: User ShacharDate: 2005-04-04 18:29:55
Subject: oledb - oledb: Update the document about the new project home site

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