pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Csaba Nagy <nagy@ecircle-ag.com>
To: Oliver Jowett <oliver@opencloud.com>
Cc: Dave Cramer <pg@fastcrypt.com>
Cc: Postgres JDBC <pgsql-jdbc@postgresql.org>
Subject: Re: Prepared statements, parameters and logging
Date: Tue, 26 Jun 2007 10:22:25 +0200
Message-ID: <1182846145.13328.95.camel@coppola.muc.ecircle.de> (raw)
In-Reply-To: <46803664.3060701@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>
	<C8485EE8-2EA6-4C87-91CB-E5370A3BDC53@fastcrypt.com>
	<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>

On Mon, 2007-06-25 at 23:40, Oliver Jowett wrote:
> 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".

Thanks Oliver for your answer.

My real question is: am I turning the right knob with
"prepareThreshold=0" ? I want all queries to be planned taking into
account the parameter values by default. I can turn this off on special
cases by setting the prepare threashold on the statement level - if the
prepareThreshold is affecting at all the fact that parameters are sent
for planning or not... is it ?

I was supposing it is, but I could not figure it out from the logging -
and the results in query execution time seem to contradict what I get by
explain on a PREPARE (which suck the same as my production system) vs.
on direct sql with parameters included (which seems to yield the correct
plan). The actual case is a query including a table which has one id
value which has very skewed cardinality compared to the average, and the
generic plan sucks badly for this one id.

Thanks,
Csaba.





view thread (12+ messages)  latest in thread

Message-ID: <1182846145.13328.95.camel@coppola.muc.ecircle.de>
Permalink:  ../1182846145.13328.95.camel@coppola.muc.ecircle.de/
Also on:    postgresql.org/message-id/1182846145.13328.95.camel@coppola.muc.ecircle.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: nagy@ecircle-ag.com, oliver@opencloud.com, pg@fastcrypt.com
  Subject: Re: Prepared statements, parameters and logging
  In-Reply-To: <1182846145.13328.95.camel@coppola.muc.ecircle.de>
  References: <1182768449.13328.60.camel@coppola.muc.ecircle.de> <6A182763-97EC-43C9-BD13-EE5375A83AC2@fastcrypt.com> <1182770018.13328.63.camel@coppola.muc.ecircle.de> <C8485EE8-2EA6-4C87-91CB-E5370A3BDC53@fastcrypt.com> <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>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox