Re: New version of money type - Mailing list pgsql-hackers

From Stephen Frost
Subject Re: New version of money type
Date
Msg-id 20060914191843.GC6548@kenobi.snowman.net
Whole thread Raw
In response to Re: New version of money type  ("D'Arcy J.M. Cain" <darcy@druid.net>)
List pgsql-hackers
* D'Arcy J.M. Cain (darcy@druid.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

pgsql-hackers by date:

Previous
From: Mark Wong
Date:
Subject: Re: Lock partitions
Next
From: Tom Lane
Date:
Subject: Re: Lock partitions