Re: Fast BigDecimal

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Fast BigDecimal
Date: 2009-04-19 08:16:14
Message-ID: 49EADDCE.90500@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Kris Jurka wrote:
>
>
> On Sat, 18 Apr 2009, Kris Jurka wrote:
>
>> On Thu, 16 Apr 2009, Heikki Linnakangas wrote:
>>
>>> Here's another patch I put together while trying to improve
>>> performance for the customer that bumped into the repeated Describe
>>> thing yesterday. It speeds up ResultSet.getBigDecimal() with the same
>>> fastpath implementation we have for getInt and getLong.
>>
>> To maintain the same behavior as the current code, you need to handle
>> the period more carefully. You must ensure that there is only one and
>> that there's at least one other number. Consider the case of SELECT
>> '.' OR SELECT '1.......'.
>>
>
> For some reason I thought this would be tricky. We just need to track
> the total number for periods seen and error out if > 1 or equal to the
> total number of characters. I've done that and committed it.

Thanks. One more thing: this accepts "-.", which the normal version
doesn't. Patch attached.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

Attachment Content-Type Size
a.patch text/x-diff 888 bytes

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2009-04-19 16:15:07 Re: Fast BigDecimal
Previous Message Kris Jurka 2009-04-19 05:20:11 Re: Fast BigDecimal