Lists: | pgsql-hackers |
---|
From: | "Pollard, Mike" <mpollard(at)cincom(dot)com> |
---|---|
To: | "Simon Riggs" <simon(at)2ndquadrant(dot)com>, "Csaba Nagy" <nagy(at)ecircle-ag(dot)com> |
Cc: | "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Greg Stark" <gsstark(at)mit(dot)edu>, "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>, "Neil Conway" <neilc(at)samurai(dot)com>, "pgsql-hackers" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: generalizing the planner knobs |
Date: | 2005-12-04 18:47:33 |
Message-ID: | 6418CC03D0FB1943A464E1FEFB3ED46B01B220FC@im01.cincom.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
Simon Riggs wrote
> ISTM we could do some of that with another GUC, lets call it
> prepare_once = on. The system default is to have a prepared statement
> bound to a plan on its first parameter bind. If we set this to "off",
> then the statement will replan each time we bind. This would give us
> both flexibility and predictability. (As ever, someone suggest a
better
> name?).
>
We call it deferred optimization.
Do you really stop at the first parameter? What if it couldn't possibly
affect the plan (<col> like '%M%', or <col> is not involved in an
index)? You can continue to plan up until the first parameter that can
affect the plan. At that point, you save off the plan, and when you get
actual values (on the execute command), continue with the planning. You
can do the same thing with correlated subqueries
Mike Pollard
SUPRA Server SQL Engineering and Support
Cincom Systems, Inc.
From: | Simon Riggs <simon(at)2ndquadrant(dot)com> |
---|---|
To: | "Pollard, Mike" <mpollard(at)cincom(dot)com> |
Cc: | Csaba Nagy <nagy(at)ecircle-ag(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Greg Stark <gsstark(at)mit(dot)edu>, "Jonah H(dot) Harris" <jonah(dot)harris(at)gmail(dot)com>, Neil Conway <neilc(at)samurai(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: generalizing the planner knobs |
Date: | 2005-12-05 08:37:24 |
Message-ID: | 1133771844.2906.865.camel@localhost.localdomain |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-hackers |
On Sun, 2005-12-04 at 13:47 -0500, Pollard, Mike wrote:
> Simon Riggs wrote
> > The system default is to have a prepared statement
> > bound to a plan on its first parameter bind.
>
> We call it deferred optimization.
>
> Do you really stop at the first parameter?
The first bind of parameters to the query, yes.
> You
> can do the same thing with correlated subqueries
Not currently done, AFAIK.
Best Regards, Simon Riggs