pg_plan_advice: Mark PARTITIONWISE inapplicable on plain rels. Previously, such advice was accepted, and just had the effect of disabling every path for the target relation, which isn't the worst imaginable behavior, but it's not difficult to do better. This commit causes such advice to instead be marked inapplicable, like INDEX_SCAN(some_table NO_SUCH_INDEX).
One advantage of this change is that it improves the test coverage provided by test_plan_advice. In fact, prior to commit 0f7dfd7936b9e99f9aeca00f52ab1692898ffff4, these changes caused test_plan_advice failures, because the defect fixed by that commit caused PARTITIONWISE advice to target the wrong relations. Without this change, the advice feedback doesn't show any sign that there's a problem, which is how that defect escaped discovery. Reported-by: Nikolay Samokhvalov <[email protected]> Discussion: http://postgr.es/m/CA+Tgmob3X+_CSjAa_BtU9bXrX_ge_HyvO=7gscltbpncgwn...@mail.gmail.com Tested-by: Jakub Wartak <[email protected]> Backpatch-through: 19 Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/2a55a15d6b7c1374716df427e701c46c009fbe2d Modified Files -------------- contrib/pg_plan_advice/expected/partitionwise.out | 49 +++++++++++++++++++++++ contrib/pg_plan_advice/pgpa_planner.c | 42 ++++++++++++++++++- contrib/pg_plan_advice/sql/partitionwise.sql | 10 +++++ 3 files changed, 99 insertions(+), 2 deletions(-)
