X-Original-To: pgsql-jdbc-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id DE8219FB224 for ; Wed, 2 Aug 2006 00:34:43 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 80074-09 for ; Wed, 2 Aug 2006 00:34:33 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [131.203.101.226]) by postgresql.org (Postfix) with ESMTP id 5499C9FACFE for ; Wed, 2 Aug 2006 00:34:29 -0300 (ADT) Received: from 203-118-178-246.bliink.ihug.co.nz ([203.118.178.246] helo=[10.1.1.6]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1G87V3-0006xR-BU; Wed, 02 Aug 2006 15:34:25 +1200 Message-ID: <44D01D40.9090002@opencloud.com> Date: Wed, 02 Aug 2006 15:34:24 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0.8 (X11/20060502) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Bob Damato CC: pgsql-jdbc@postgresql.org Subject: Re: JDBC Overhead References: <3C0EE29939948549A093F180634257028F2895@ex-1.coxtarget.com> In-Reply-To: <3C0EE29939948549A093F180634257028F2895@ex-1.coxtarget.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200608/6 X-Sequence-Number: 15533 Bob Damato wrote: > ------------------------------------------------------- > ps = con.prepareStatement("SELECT 1"); > long execStart = System.currentTimeMillis(); > rs = ps.executeQuery(); > System.err.println ("Query executed in " + (System.currentTimeMillis() - > execStart) + "ms"); > -------------------------------------------------------- > > Result of this code is: > Query executed in 57ms Try a better benchmark, what you are probably measuring there is mostly classloading, JIT, and similar startup costs. How long does it take on the 1000th execution? Also, unless you are specifically measuring query time when reexecuting the same PreparedStatement many times, you should include the cost of prepareStatement() in your measurements. -O