Re: NUMERIC private methods?

Поиск
Список
Период
Сортировка
От David Fetter
Тема Re: NUMERIC private methods?
Дата
Msg-id 20141216133145.GB10843@fetter.org
обсуждение исходный текст
Ответ на Re: NUMERIC private methods?  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Список pgsql-hackers
On Tue, Dec 16, 2014 at 09:01:47AM +0000, Andrew Gierth wrote:
> >>>>> "Heikki" == Heikki Linnakangas <hlinnakangas@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 <david@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.com

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Mark Cave-Ayland
Дата:
Сообщение: Re: Commitfest problems
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: Re: KNN-GiST with recheck