-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Query Planning
-
None
-
Query Optimization
Today's behavior of the "queryPlanner" explain verbosity is that it generates the set of candidate plans, passes these plans to the multi-planner, and uses the plan ranker to select a winner. The winner and rejected plans are all reported, without any accompanying execution stats.
Despite the lack of execution stats, the multi-planning trial period took place in order to choose the winning plan. This means that the system has gathered the execution stats from the trial period, but does not report them. This ticket proposes a new explain mode which behaves like "queryPlanner" but also reports the trial period information – presumably in the usual "allPlansExecution" format. If a user wants to see information about the trial period today, they must instead run explain at "executionStats" or "allPlansExecution" verbosity, which also has the adverse effect of running the winning plan to completion.
I imagine that this new explain mode could be particularly useful when diagnosing a plan selection problem that results in an extremely slow plan. Imagine, for instance, that a multi-planning bug in a customer environment is selecting a plan which does a very large index scan. The customer may wish to try to reproduce this problem using explain in order to gather diagnostics about the plan selection behavior – without taking the performance penalty associated with actually executing the very unselective and thus very slow winning index scan plan.