Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id D89629FB96B for ; Tue, 26 Jun 2007 06:25:39 -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 88067-01 for ; Tue, 26 Jun 2007 06:25:31 -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 AC61E9FB4D5 for ; Tue, 26 Jun 2007 06:25:34 -0300 (ADT) Received: from einstein.muc.ecircle.de (einstein.muc.ecircle.de [192.168.1.7]) by mail.ecircle.de (READY) with ESMTP id 8AD7B55C02F; Tue, 26 Jun 2007 11:25:33 +0200 (CEST) Received: from [192.168.1.91] ([192.168.1.91]) by einstein.muc.ecircle.de with Microsoft SMTPSVC(6.0.3790.1830); Tue, 26 Jun 2007 11:25:32 +0200 Subject: Re: Prepared statements, parameters and logging From: Csaba Nagy To: Oliver Jowett Cc: Dave Cramer , Postgres JDBC In-Reply-To: <4680D822.20205@opencloud.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> <1182778475.13328.79.camel@coppola.muc.ecircle.de> <46803664.3060701@opencloud.com> <1182846145.13328.95.camel@coppola.muc.ecircle.de> <4680D822.20205@opencloud.com> Content-Type: text/plain Message-Id: <1182849932.13328.107.camel@coppola.muc.ecircle.de> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Tue, 26 Jun 2007 11:25:32 +0200 Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 26 Jun 2007 09:25:32.0786 (UTC) FILETIME=[F1E83D20:01C7B7D3] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/103 X-Sequence-Number: 17165 Oliver, Now this was enlightening... now I finally understand the behavior I see. > If you set prepareThreshold=0 then an unnamed statement should always be > used (& therefore actual parameter values should be taken into account > when planning), with one exception: the setFetchSize() case I described > in my earlier email. The setFetchSize must be the cause I see the unnamed statements (I have it automatically added to all of our select statements). For a query with limit on it (the case of my problem-query), the fetch size is not very useful, I'll get rid of it... > If you set logLevel=2 on the driver, you should be able to see the > differences in the protocol flow in more detail than the server logging > lets you see. Thanks for the tip, I'll do that too next time... for the current situation your explanation is more then enough. Thanks, Csaba.