Tom Lane wrote:
"Jonah H. Harris" <[EMAIL PROTECTED]> writes:
On Fri, Nov 14, 2008 at 11:43 AM, Tom Lane <[EMAIL PROTECTED]> wrote:
IMHO, the only thing worse than an unstable plan is a stable one.

Your opinion contradicts the majority of the industry then, I'm
afraid.  Like query hints, people are sometimes smarter than the
optimizer.

And, very often, they're not --- or more likely, they were smarter than
the optimizer last year, but now conditions have changed.  Failing to
adapt to new conditions is exactly the problem with query hints, and
in general with any insistence that plans should be "stable".

Those are both very simplistic views. Yes, the planner often knows better. Yes, the DBA also often knows better.

Stable plans are by no means a silver bullet. If a table suddenly changes dramatically in size, you certainly do want to replan your queries. The typical scenario that people want to avoid with stable plans is where a table grows slowly, until it reaches a critical point, and the planner chooses a different plan, and the new plan happens to be very bad. The scary thing about that is that it can happen at an unpredictable time, and it can be really hard to convince the planner to choose the old plan again.

It's a tradeoff, for sure. Ideally the planner would be infallible. Failing that, it would be nice to provide the DBA some tools to control when new plans are taken into use.

--
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Reply via email to