X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 0C1379DC826 for ; Wed, 8 Mar 2006 10:12:00 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 13217-03 for ; Wed, 8 Mar 2006 10:12:03 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by postgresql.org (Postfix) with SMTP id 6DE339DC815 for ; Wed, 8 Mar 2006 10:11:57 -0400 (AST) Received: (qmail 22927 invoked from network); 8 Mar 2006 14:12:01 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.2?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 8 Mar 2006 14:12:01 -0000 In-Reply-To: <224f32340603080537ld424d49l2eea9440594104d3@mail.gmail.com> References: <224f32340603080537ld424d49l2eea9440594104d3@mail.gmail.com> Mime-Version: 1.0 (Apple Message framework v746.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <8CEC950B-123B-400B-92C3-49EC437B10F8@fastcrypt.com> Cc: pgsql-jdbc@postgresql.org Content-Transfer-Encoding: 7bit From: Dave Cramer Subject: Re: Performance problem with timestamps in result sets Date: Wed, 8 Mar 2006 09:11:59 -0500 To: Thomas Dudziak X-Mailer: Apple Mail (2.746.2) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.121 required=5 tests=[AWL=0.121] X-Spam-Score: 0.121 X-Spam-Level: X-Archive-Number: 200603/30 X-Sequence-Number: 14811 Thomas, That can't possibly be ... Dave On 8-Mar-06, at 8:37 AM, Thomas Dudziak wrote: > Hi, > > while profiling an application of ours, I noticed a performance > problem with the PostgreSQL JDBC driver (the same for any version: > 8.0, 8.1, 8.2dev-501). > In short, whenever the ResultSet contains a timestamp value, the JDBC > driver takes nearly one second to extract it (this is against a 8.0 on > Windows, database and application on the same machine; with a > non-development configuration, the number would be a bit lower). > The profiling shows that the culprit is > > -> AbstractJdbc2ResultSet.getTimestamp(int) : 7130ms | 8190 calls > -> TimestampUtils.loadCalendar(GregorianCalendar, String, String) > : 5417ms | 8190 calls > -> TimestampUtils.firstNonDigit : 2163ms | 49140 times > -> TimestampUtils.number(String, int, int) : 1562ms | 49140 > times > > Now my question is, is there something to make this faster ? Nearly > 1sec for a ResulSet.getTimestamp call is too much for us. > > cheers, > Tom > > ---------------------------(end of > broadcast)--------------------------- > TIP 1: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that > your > message can get through to the mailing list cleanly >