Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-74290

Support persistent query setting to disable auto-parameterization on a per query shape basis

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Query Planning
    • Labels:
      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.

            Assignee:
            backlog-query-optimization [DO NOT USE] Backlog - Query Optimization
            Reporter:
            david.storch@mongodb.com David Storch
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: