Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 5E0479FB88E for ; Mon, 25 Jun 2007 10:34:46 -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 11863-06 for ; Mon, 25 Jun 2007 10:34:32 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail.ecircle.de (mail.ecircle.de [195.140.186.200]) by postgresql.org (Postfix) with ESMTP id B71089FB502 for ; Mon, 25 Jun 2007 10:34:37 -0300 (ADT) Received: from einstein.muc.ecircle.de (einstein.muc.ecircle.de [192.168.1.7]) by mail.ecircle.de (READY) with ESMTP id 4E01311C003; Mon, 25 Jun 2007 15:34:36 +0200 (CEST) Received: from [192.168.1.91] ([192.168.1.91]) by einstein.muc.ecircle.de with Microsoft SMTPSVC(6.0.3790.1830); Mon, 25 Jun 2007 15:34:35 +0200 Subject: Re: Prepared statements, parameters and logging From: Csaba Nagy To: Dave Cramer Cc: Postgres JDBC In-Reply-To: <9537AA08-53BB-434E-9E62-F326AADED792@fastcrypt.com> 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> Content-Type: text/plain Message-Id: <1182778475.13328.79.camel@coppola.muc.ecircle.de> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Mon, 25 Jun 2007 15:34:35 +0200 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 25 Jun 2007 13:34:35.0077 (UTC) FILETIME=[91CB2750:01C7B72D] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/97 X-Sequence-Number: 17159 On Mon, 2007-06-25 at 15:11, Dave Cramer wrote: > I think the text should be specifying that once you exceed > preparedThreshold executions the driver uses a named prepared > statement, and can re-use it. Otherwise it uses unnamed prepared > statements which need to be prepared for each execution. OK, but I also thought that the value 0 means no reuse at all, i.e. it should always prepare for each execution... and 1 should mean always reuse, from the first statement on. 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. 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... I distinctly remember discussing this issue some time ago on this list, back then I needed the opposite action, to disable the one-time-prepare by default... now I just need the opposite, to enable it by default even for repetitive queries... is that possible ? Cheers, Csaba.