Skip site navigation (1) Skip section navigation (2)

Re: Bind message

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Markus Schaber <schabi(at)logix-tt(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Bind message
Date: 2006-09-26 12:26:13
Message-ID: 45191C65.3080705@opencloud.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
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

In response to

pgsql-jdbc by date

Next:From: till toengesDate: 2006-09-26 13:07:12
Subject: Re: bytea memory improvement
Previous:From: Markus SchaberDate: 2006-09-26 12:00:45
Subject: Re: Bind message

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group