pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Markus Schaber <schabi@logix-tt.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Bind message
Date: Wed, 27 Sep 2006 00:26:13 +1200
Message-ID: <45191C65.3080705@opencloud.com> (raw)
In-Reply-To: <4519166D.9040705@logix-tt.com>
References: <D4D1632DC736E74AB95FE78CD609007923B0F7@mtxexch01.add0.masergy.com>
	<Pine.BSO.4.63.0609251417310.4350@leary2.csoft.net>
	<451846B0.6070906@logix-tt.com>
	<45184D61.3010007@opencloud.com>
	<4518E986.3030801@logix-tt.com>
	<4518FF16.3050804@opencloud.com>
	<4519166D.9040705@logix-tt.com>

Markus Schaber wrote:
> Hi, Oliver,
> 
> Oliver Jowett wrote:

>>Isn't this just a very roundabout way of overriding the planner? i.e.
>>what you are really doing is saying "ignore your statistics, I know more
>>about the parameter values I'm going to give you than I'm actually
>>telling you"..
> 
> 
> No, it's telling the planner "You can assume that all those queries for
> my statement are similar enough that the same query plan will fit them,
> so you can safe the overhead of both parsing and planning".

What I mean is, if you are prepared to say that, what you are really 
wanting is to second-guess the planner and tell the server "use *THIS* 
plan" explicitly .. In both approaches, you (the app developer) need 
detailed knowledge about what sort of plans work for the parameters & 
query you are using (for your particular server version and dataset etc).

Doing that at the Parse/Bind level doesn't seem right and in fact seems 
even more errorprone than explicitly specifying a plan, since you are 
relying on the planner picking a particular plan for a particular set of 
parameter values that you happened to use first which may or may not 
always be true depending on things like the current state of DB statistics..

-O



view thread (18+ messages)  latest in thread

Message-ID: <45191C65.3080705@opencloud.com>
Permalink:  ../45191C65.3080705@opencloud.com/
Also on:    postgresql.org/message-id/45191C65.3080705@opencloud.com

 · 

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: oliver@opencloud.com, schabi@logix-tt.com
  Subject: Re: Bind message
  In-Reply-To: <45191C65.3080705@opencloud.com>
  References: <D4D1632DC736E74AB95FE78CD609007923B0F7@mtxexch01.add0.masergy.com> <Pine.BSO.4.63.0609251417310.4350@leary2.csoft.net> <451846B0.6070906@logix-tt.com> <45184D61.3010007@opencloud.com> <4518E986.3030801@logix-tt.com> <4518FF16.3050804@opencloud.com> <4519166D.9040705@logix-tt.com> <45191C65.3080705@opencloud.com>

* 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