generalizing the planner knobs - Mailing list pgsql-hackers

From Neil Conway
Subject generalizing the planner knobs
Date
Msg-id 1133433059.16522.21.camel@localhost.localdomain
Whole thread Raw
Responses Re: generalizing the planner knobs
Re: generalizing the planner knobs
List pgsql-hackers
There are currently some rather crude knobs for persuading the planner
to favour certain kinds of query plans: the enable_XXX GUC variables.
Several people have asked for a more flexible way to give hints to the
planner. I'm not interested in implementing fully-general planner hints
at the moment, but ISTM that a simple improvement to what we have now
would allow for a wider range of planner hints with only minor changes:
we could replace the enable_XXX variables with a set of variables that
would add an arbitrary constant to the estimated cost of each type of
query node. (Alternatively, an arbitrary multiplier could be specified;
I'm not sure which would be better.)

This would also be useful when diagnosing bad query plans: for example,
setting enable_seqscan=false often causes the planner to disregard the
use of *any* sequential scan, anywhere in the plan. The ability to
slightly bump up the cost of particular operations would allow more
alternative plans to be examined.

On the other hand, the whole mechanism is still a hack. It also means
that applications using this will be more dependent on the actual
costing values produced by the planner, which is not good. However, if
you're in the sort of desperate straights where this sort of hackery is
required, perhaps that's acceptable.

Comments?

-Neil




pgsql-hackers by date:

Previous
From: Richard Huxton
Date:
Subject: Re: [pgsql-www] Upcoming PG re-releases
Next
From: Christopher Kings-Lynne
Date:
Subject: Docs misspelling