X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B97FA8B9E37 for ; Tue, 15 Feb 2005 23:00:32 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 36847-02 for ; Tue, 15 Feb 2005 23:00:15 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id AA5408B9EC4 for ; Tue, 15 Feb 2005 23:00:10 +0000 (GMT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1D1Bfi-0003Tz-00; Wed, 16 Feb 2005 11:59:58 +1300 Message-ID: <42127EEC.3000502@opencloud.com> Date: Wed, 16 Feb 2005 11:59:56 +1300 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0 (X11/20041228) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Antony Paul Cc: pgsql-jdbc@postgresql.org Subject: Re: Pass column name in preparedstatement References: <2989532e050215032031e9aeb8@mail.gmail.com> <4211E2E1.4090506@opencloud.com> <2989532e05021504045fc879fe@mail.gmail.com> In-Reply-To: <2989532e05021504045fc879fe@mail.gmail.com> X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/113 X-Sequence-Number: 12293 Antony Paul wrote: > In 7.3.3 is there any use in using PreparedStatement since the columns > may change for each query. It depends on your application; are there non-column-name parameters? If so, using PreparedStatement still gives you the benefit that you do not have to escape those parameters by hand. Under 7.3.x there's no real performance benefit to reusing PreparedStatements, as the v3 protocol (supporting server-side query parameterization and reuse) was only introduced in 7.4. Under 7.4 or 8.0, there is some scope for improved performance if you reuse PreparedStatements. As your query strings are changing, you may want to have a cache to preserve a PreparedStatement for frequently used queries. You really should upgrade if you're still using 7.3.3, at least to the latest 7.3.x. -O