Re: New version of money type

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: New version of money type
Дата
Msg-id 20060914191843.GC6548@kenobi.snowman.net
обсуждение исходный текст
Ответ на Re: New version of money type  ("D'Arcy J.M. Cain" <darcy@druid.net>)
Список 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 по дате отправления:

Предыдущее
От: Mark Wong
Дата:
Сообщение: Re: Lock partitions
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Lock partitions