Re: New version of money type

Поиск
Список
Период
Сортировка
От Theo Schlossnagle
Тема Re: New version of money type
Дата
Msg-id 09D462F2-1D83-4519-9324-A56D151E612C@omniti.com
обсуждение исходный текст
Ответ на Re: New version of money type  ("Jim C. Nasby" <jimn@enterprisedb.com>)
Ответы Re: New version of money type  (Stephen Frost <sfrost@snowman.net>)
Re: New version of money type  (Gregory Stark <stark@enterprisedb.com>)
Список pgsql-hackers
On Sep 16, 2006, at 5:27 PM, Jim C. Nasby wrote:

> On Thu, Sep 14, 2006 at 11:12:14AM -0400, D'Arcy J.M. Cain 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.
>
> Has anyone looked at changing numeric so that for numbers with less  
> than
> 9 digits it stores/uses an int, and for between 10 and 18 digits it  
> uses
> a bigint? Perhaps that would net every numeric user a speed  
> improvement.

Would that pose indexing issues?  It would also mean that when  
joining two tables you'd have to handle some interesting type  
conversion issues (at times).  We had someone accidentally create a  
largish table with userid as "numeric" and other tables are "bigint",  
it was disastrous for performance (joining).  I'd imagine that if the  
above wasn't done cleverly, that performance problem would be repeated.

// Theo Schlossnagle
// CTO -- http://www.omniti.com/~jesus/
// OmniTI Computer Consulting, Inc. -- http://www.omniti.com/




В списке pgsql-hackers по дате отправления:

Предыдущее
От: mark@mark.mielke.cc
Дата:
Сообщение: Re: Reducing data type space usage
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Reducing data type space usage