Re: double and numeric conversion - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: double and numeric conversion
Date
Msg-id 162867791003030228n67a4111t4fdd9dc33346efa4@mail.gmail.com
Whole thread Raw
In response to Re: double and numeric conversion  (Yeb Havinga <yebhavinga@gmail.com>)
Responses Re: double and numeric conversion
List pgsql-hackers
2010/3/3 Yeb Havinga <yebhavinga@gmail.com>:
> Theo Schlossnagle wrote:
>>
>> I didn't look deeply at the postgres internals to see if there was a way
>> to do double -> numeric and integer-types -> numeric without intermediary
>> string format.  If that sort of thing is easy to leverage, I'd be happy to
>> share the code.
>>
>
> I think your code could be valuable for postgres on the fact alone that it
> is almost twice as fast, and probably easy to integrate and unit test. We
> make heavy use of the numeric data type, so I'm very interested!

I did some test and numeric->double is about 5% faster than
numeric->string->double (on my PC)

Regards
Pavel Stehule


>
> regards
> Yeb Havinga
>
>
>
> --
> Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-hackers
>


pgsql-hackers by date:

Previous
From: Yeb Havinga
Date:
Subject: Re: double and numeric conversion
Next
From: Yeb Havinga
Date:
Subject: Re: double and numeric conversion