Re: New version of money type

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: "D'Arcy J(dot)M(dot) Cain" <darcy(at)druid(dot)net>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: New version of money type
Date: 2006-09-14 19:18:43
Message-ID: 20060914191843.GC6548@kenobi.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

* D'Arcy J.M. Cain (darcy(at)druid(dot)net) wrote:
> The benefit of the money type is speed. Because internal operations
> are done on integers they can generally be handled by single CPU ops.
> My tests on the 64 bit version show 10% to 25% improvement over numeric
> for many operations.

Erm, the numeric is doing integer ops too mostly, no? Perhaps I'm
missing something here.. What *exactly* makes it faster than numeric,
and why couldn't numeric use that improvement? The one thing I can
think of right off would be having a 64bit-base numeric type instead of
the current 32bit-base (which limits us to base-10,000 while 64bit would
give us base-1,000,000,000, which means more done in one operation and
so less work overall- *if* you can do fast 64bit integer operations,
which isn't necessairly the case on all architectures...).

If that's where the improvment is then let's add a 'numeric64' type.

Thanks,

Stephen

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-09-14 19:23:48 Re: Lock partitions
Previous Message Mark Wong 2006-09-14 19:05:13 Re: Lock partitions