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

Re: Performance gain from reduction of GROUP BY memory

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>,Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Performance gain from reduction of GROUP BY memory
Date: 2005-08-30 14:39:52
Message-ID: 20050830143952.GI16133@surnet.cl (view raw or flat)
Thread:
Lists: pgsql-announcepgsql-hackers
On Tue, Aug 30, 2005 at 10:23:49AM -0400, Bruce Momjian wrote:

> > > 2005-03-12 15:25  tgl
> > > 
> > > 	* contrib/intagg/int_aggregate.c,
> > > 	contrib/intagg/int_aggregate.sql.in, doc/src/sgml/xaggr.sgml,
> > > 	doc/src/sgml/xfunc.sgml, src/backend/executor/nodeAgg.c,
> > > 	src/backend/utils/adt/int8.c: Adjust the API for aggregate function
> > > 	calls so that a C-coded function can tell whether it is being used
> > > 	as an aggregate or not.  This allows such a function to avoid
> > > 	re-pallocing a pass-by-reference transition value; normally it
> > > 	would be unsafe for a function to scribble on an input, but in the
> > > 	aggregate case it's safe to reuse the old transition value.  Make
> > > 	int8inc() do this.  This gets a useful improvement in the speed of
> > > 	COUNT(*), at least on narrow tables (it seems to be swamped by I/O
> > > 	when the table rows are wide).	Per a discussion in early December
> > > 	with Neil Conway.  I also fixed int_aggregate.c to check this,
> > > 	thereby turning it into something approaching a supportable
> > > 	technique instead of being a crude hack.
> 
> I don't usually document internal API changes in the release notes. 
> Should I?

Doesn't this potentially affect user-defined aggregates?

-- 
Alvaro Herrera <alvherre[]alvh.no-ip.org>      Architect, www.EnterpriseDB.com
"Lo esencial es invisible para los ojos" (A. de Saint Ex├║pery)

In response to

Responses

pgsql-announce by date

Next:From: Bruce MomjianDate: 2005-08-30 14:43:04
Subject: Re: Performance gain from reduction of GROUP BY memory
Previous:From: Bruce MomjianDate: 2005-08-30 14:23:49
Subject: Re: Performance gain from reduction of GROUP BY memory

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2005-08-30 14:43:04
Subject: Re: Performance gain from reduction of GROUP BY memory
Previous:From: Thomas F. O'ConnellDate: 2005-08-30 14:27:51
Subject: Re: 8.1beta, SunOS and shmget

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