Re: Let's drop two obsolete features which are bear-traps for novices - Mailing list pgsql-hackers

From David Fetter
Subject Re: Let's drop two obsolete features which are bear-traps for novices
Date
Msg-id 20141104015241.GA24908@fetter.org
Whole thread Raw
In response to Re: Let's drop two obsolete features which are bear-traps for novices  (Tatsuo Ishii <ishii@postgresql.org>)
Responses Re: Let's drop two obsolete features which are bear-traps for novices
List pgsql-hackers
On Tue, Nov 04, 2014 at 07:51:06AM +0900, Tatsuo Ishii wrote:
> > The performance of our numeric vs Oracle's was a common complaint when
> > I was at EnterpriseDB (in 2007).
> > 
> > Perhaps numeric's performance could be greatly improved in cases where
> > the precision is low enough to map to an int/bigint. That would get us
> > closer to eliminating money as well as give other uses a big win. Of
> > course, how to do that and not break pg_upgrade is a huge question...
> 
> Just out of curiosity, why is Oracle's NUMBER (I assume you are
> talking about this) so fast?

I suspect that what happens is that NUMBER is stored as a native type
(int2, int4, int8, int16) that depends on its size and then cast to
the next upward thing as needed, taking any performance hits at that
point.  The documentation hints (38 decimal places) at a 128-bit
internal representation as the maximum.  I don't know what happens
when you get past what 128 bits can represent.

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
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

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



pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: pg_multixact not getting truncated
Next
From: Craig Ringer
Date:
Subject: Re: Pipelining executions to postgresql server