Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 1C68B9FBBAA for ; Mon, 25 Jun 2007 18:40:56 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 20276-01-5 for ; Mon, 25 Jun 2007 18:40:45 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by postgresql.org (Postfix) with ESMTP id 7D0349FBB7D for ; Mon, 25 Jun 2007 18:40:41 -0300 (ADT) Received: from 222-154-170-159.jetstream.xtra.co.nz ([222.154.170.159] helo=[10.1.1.3]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1I2wIS-00067e-3a; Tue, 26 Jun 2007 09:40:32 +1200 Message-ID: <46803664.3060701@opencloud.com> Date: Tue, 26 Jun 2007 09:40:52 +1200 From: Oliver Jowett User-Agent: Thunderbird 1.5.0.12 (Windows/20070509) MIME-Version: 1.0 To: Csaba Nagy CC: Dave Cramer , Postgres JDBC Subject: Re: Prepared statements, parameters and logging References: <1182768449.13328.60.camel@coppola.muc.ecircle.de> <6A182763-97EC-43C9-BD13-EE5375A83AC2@fastcrypt.com> <1182770018.13328.63.camel@coppola.muc.ecircle.de> <1182775348.13328.69.camel@coppola.muc.ecircle.de> <9537AA08-53BB-434E-9E62-F326AADED792@fastcrypt.com> <1182778475.13328.79.camel@coppola.muc.ecircle.de> In-Reply-To: <1182778475.13328.79.camel@coppola.muc.ecircle.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/98 X-Sequence-Number: 17160 Csaba Nagy wrote: > Before I was using prepareThreshold='1', and I was seeing only such > entries in the server log: > > duration: 5437.499 ms statement: EXECUTE [PREPARE: SELECT > ... ] > > Note the in the log entry, it was always there for each > statement. I believe that's logging execution of an unnamed portal, not an unnamed statement. I'm not sure whether the current server logging actually lets you tell whether a named statement was used/reused or not (at least that was one of my complaints about early versions of it -- haven't checked what current versions do). If the statement name is logged, it'd be something like "S_12345". > After setting prepareThreshold='0', I started getting 2 kinds of log > entries, the ones like above, and the likes: > > duration: 2200.570 ms statement: EXECUTE C_220047 [PREPARE: SELECT > ... ] > > Note the C_220047, that's what's changed... C_.... are portals ("cursors") If you're using setFetchSize() to avoid pulling in the whole resultset at once, the driver has to use a named statement and named portal regardless of the prepare-threshold setting (because portals are closed when their creating statement is closed, and the unnamed statement gets closed when reused) -O