setQuerySettings index hints and queryFramework
Parent: Operation rejection filters · Published reference · snapshot 2026-10-31
↓ Facts as markdownall context files
Source-anchored research for setQuerySettings index hints and queryFramework. Run status: COMPLETED.
These notes link each claim to its source. Some citations identify archived research reports that are no longer hosted on this site. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
How it works
- Tencent recommends restricting index pinning to critical queries because excessive pinning limits adaptation to changing data distributions; test representative parameter values before applying a policy. (low confidence) [source]
Problems, failure modes and limitations
- Index hints restrict candidate indexes but do not guarantee index use: a collection scan can still win. An allow-list alone therefore cannot establish that a shape avoids collection scans. (medium confidence) [source]
- Inspect winningPlan.slotBasedPlan in explain output or queryFramework in slow-operation logs to identify the executed engine. (low confidence) [source]
Comparisons and alternatives
- queryFramework accepts classic or sbe. MongoDB determines SBE eligibility per query and uses classic for ineligible queries; verify the executed engine rather than assuming universal SBE support. (medium confidence) [source]
Facts and statements
- Introduced in MongoDB 8.0, setQuerySettings applies shape-based policies to find, distinct, and aggregate across a cluster; settings survive restarts. (medium confidence) [source]
- Supply a representative command with $db, or an existing query shape hash string, as setQuerySettings; put the policy in the separate settings document. (medium confidence) [source]
- indexHints entries identify a namespace through ns.db and ns.coll; allowedIndexes accepts index names, key patterns, or $natural hints. A single entry may omit the array brackets. (medium confidence) [source]
- Matching query settings with index hints override command-level index hints; changing a command hint does not change its query shape. (medium confidence) [source]
- reject: true rejects new matching queries but leaves running operations unaffected. Index hints and queryFramework appear alongside reject in the same settings document. (medium confidence) [source]
- Inspect applied policies with $querySettings and the querySettings information in explain output, including per-shard entries where shown, then inspect the winning plan to confirm the selected access path. (medium confidence) [source]
- Percona ClusterSync documentation dated 2026-10-13 says it does not automatically migrate persistent query settings. Export them with $querySettings and apply them separately on the destination. (low confidence) (verified as of 2026-10-31) [source]
- SERVER-89299 records a historical bug where repeating setQuerySettings for a $setWindowFields pipeline produced different queryShapeHash values and multiple configurations. The issue lists 8.0.0-rc3 among its fixes; it is not evidence of a current unfixed 8.0 defect. (low confidence) (verified as of 2026-10-31) [source]
Children
- No children recorded.