>>>>> "Heikki" == Heikki Linnakangas <hlinnakangas@vmware.com> writes:
Heikki> Looking at the weighed_stats code, this probably illustratesHeikki> the hoops you had to jump through:
Actually that hoop-jumping expression is almost irrelevant.
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).
--
Andrew (irc:RhodiumToad)