Details
-
Improvement
-
Resolution: Unresolved
-
Major - P3
-
None
-
None
-
None
-
Query Execution
Description
The execution stages MultiPlanStage and SubplanStage exist as hacks to help the query engine pick the best choice out of a set of query solutions. These stages should not exist. Instead, the query planner should be given explicit access to a piece of machinery that takes a set of query solutions, creates a PlanExecutor for each, runs each for a trial period, and makes a decision on which is the best one. The plan ranker should be expanded to include this machinery.
The dependency of the query planner on the query execution subsystem reflects the reality of the query engine's trial-based planning model. If the number of calls that the query planner makes into the query execution subsystem is sufficiently contained, then they will be easy to remove once the query engine is rewritten to accommodate a stats-based planning model.