diff --git a/contrib/pg_plan_advice/README b/contrib/pg_plan_advice/README index 2ea61e9bc41..2be40f0eba6 100644 --- a/contrib/pg_plan_advice/README +++ b/contrib/pg_plan_advice/README @@ -263,5 +263,3 @@ good idea to incorporate that ability at some future point, as pg_hint_plan does. However, since the primary goal of the initial development work is to be able to induce the planner to recreate a desired plan that worked well in the past, this has not been included in the initial development effort. - -XXX Need to investigate whether and how well supplying advice works with GEQO diff --git a/doc/src/sgml/pgplanadvice.sgml b/doc/src/sgml/pgplanadvice.sgml index b1395ec951e..0116b0d88f7 100644 --- a/doc/src/sgml/pgplanadvice.sgml +++ b/doc/src/sgml/pgplanadvice.sgml @@ -812,6 +812,22 @@ EXPLAIN (COSTS OFF) force the choice of a plan which the planner refused to consider in the first place. + + + One consequence of the limitation described in the previous paragraph is + that plan advice works only probabilistically when + GEQO is used. Even if plans + compatible with the supplied advice exist, there is no guarantee that any + of them will be a part of the randomly generated pool of candidates. If + not, the planner will generate a plan that does not comply with the + supplied advice, with some parts of that plan marked disabled. If you + supply advice that only mildly constrains join planning, + GEQO will usually manage to find a plan that conforms + with it; but if you wish to constrain it more substantially, you may need + to disable GEQO in order to obtain satisfactory results. + Note that scan advice is not affected by this limitation because it does + not constrain the join order. +