Received: from localhost (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 4FA0B6333FF for ; Sun, 19 Apr 2009 02:20:15 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 95224-03 for ; Sun, 19 Apr 2009 02:20:13 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from leary.csoft.net (leary.csoft.net [205.205.214.5]) by mail.postgresql.org (Postfix) with ESMTP id 0DC84632892 for ; Sun, 19 Apr 2009 02:20:12 -0300 (ADT) Received: by leary.csoft.net (Postfix, from userid 1112) id AE02EAADD; Sun, 19 Apr 2009 01:20:11 -0400 (EDT) Date: Sun, 19 Apr 2009 01:20:11 -0400 (EDT) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: Heikki Linnakangas cc: pgsql-jdbc@postgresql.org Subject: Re: Fast BigDecimal In-Reply-To: Message-ID: References: <49E72C90.9010903@enterprisedb.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200904/66 X-Sequence-Number: 19513 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. Kris Jurka