-
Type: Improvement
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Query Planning
-
None
-
Query Optimization
We are considering adding a new feature called "persistent query settings" that will allow index hints or other configuration options to be associated with a query shape in a persistent fashion. The initial release of this feature will likely support the following:
- Persistent index filters which will supersede the index filters feature as it exists today.
- A flag to force a query shape to use the classic engine (or maybe to force a particular query shape to use SBE).
Once this mechanism is in place, we should consider extending it to support controls around auto-parameterization. This would probably be a boolean flag to enable/disable auto-parameterization on a per-query basis. Auto-parameterization is valuable in that it allows plans to be cached and reused for queries that differ only in their parameter values. However, there are also downsides to auto-parameterization. It can inhibit optimizations, since parameterized plans must work for all possible parameter values. Also, there may be additional runtime indirections such as reading the constants out of SBE's RuntimeEnvironment rather than having constants inlined. Since auto-parameterization may help or hurt a query shape depending on the workload, it would be nice to give the user some administrative controls. For example, a knowledgeable user could disable auto-parameterization only for those queries for which auto-parameterization defeats an important optimization.