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

From: David Fetter <david(at)fetter(dot)org>
To: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: Tatsuo Ishii <ishii(at)postgresql(dot)org>, "Jim(dot)Nasby(at)BlueTreble(dot)com" <Jim(dot)Nasby(at)BlueTreble(dot)com>, "alvherre(at)2ndquadrant(dot)com" <alvherre(at)2ndquadrant(dot)com>, "michael(dot)banck(at)credativ(dot)de" <michael(dot)banck(at)credativ(dot)de>, "tgl(at)sss(dot)pgh(dot)pa(dot)us" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "andrew(at)dunslane(dot)net" <andrew(at)dunslane(dot)net>, "jaime(at)2ndquadrant(dot)com" <jaime(at)2ndquadrant(dot)com>, "andres(at)2ndquadrant(dot)com" <andres(at)2ndquadrant(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, "josh(at)agliodbs(dot)com" <josh(at)agliodbs(dot)com>, "cktan(at)vitessedata(dot)com" <cktan(at)vitessedata(dot)com>
Subject: Re: Let's drop two obsolete features which are bear-traps for novices
Date: 2014-11-05 05:19:11
Message-ID: 20141105051911.GA15872@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Nov 04, 2014 at 08:30:21AM +0000, Laurenz Albe wrote:
> David Fetter wrote:
> > On Tue, Nov 04, 2014 at 07:51:06AM +0900, Tatsuo Ishii wrote:
> >> 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.
>
> No, Oracle stores NUMBERs as variable length field (up to 22 bytes),
> where the first byte encodes the sign and the comma position and the
> remaining bytes encode the digits, each byte representing two digits
> in base-100 notation (see Oracle Metalink note 1007641.6).

Thanks for clearing that up, and sorry for spreading misinformed
guesses.

> So it's not so different from PostgreSQL.
> No idea why their arithmetic should be faster.

I have an idea, but this time, I think it's right. They have at least
one team of people whose job it is to make sure that it is fast.

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Nasby 2014-11-05 05:43:49 Re: tracking commit timestamps
Previous Message Ashutosh Bapat 2014-11-05 04:36:10 Re: Convert query plan to sql query