On Tue, Dec 16, 2014 at 09:01:47AM +0000, Andrew Gierth wrote: > >>>>> "Heikki" == Heikki Linnakangas <hlinnakan...@vmware.com> writes: > > Heikki> Looking at the weighed_stats code, this probably illustrates > Heikki> the hoops you had to jump through: > > Actually that hoop-jumping expression is almost irrelevant.
Right. Not that it made things fun or easy (at least for me) to debug, as you can see by the git history. > The part that hurts (and yes, it's performance that's at issue here, > and not code aesthetics) is not being able to use NumericVar in the > aggregate's transition variable, because that means that every > computed intermediate value is palloc'd and pfree'd twice (once as > the digit buffer of a NumericVar and again as a Numeric datum). Yep. Performance of NUMERIC might yet get some of the love it deserves. Perhaps something along the lines of a 128-bit default structure with a promotion/demotion scheme for larger representations. Until then, those of us writing extensions are stuck with heaps of extra instructions in it that could easily be trimmed away to good effect. Cheers, David. -- David Fetter <da...@fetter.org> http://fetter.org/ Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter Skype: davidfetter XMPP: david.fet...@gmail.com Remember to vote! Consider donating to Postgres: http://www.postgresql.org/about/donate -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers