Re: generalizing the planner knobs

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
Thread:
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.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2005-12-04 18:53:06 Re: [PATCHES] snprintf() argument reordering not working
Previous Message Tom Lane 2005-12-04 18:32:56 Re: Reducing relation locking overhead