-
Type:
Task
-
Resolution: Fixed
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
Fully Compatible
-
QE 2026-04-13
-
None
-
None
-
None
-
None
-
None
-
None
-
None
Situation:
- There are two collections: main, secondary.
- Indexes on both collections: "a_1", "a_1_b"1
- Query: main.aggregate($match, $lookup, hint: "a_1")
- Query Settings: indexHints: "test.secondary", allowedIndexes: ["a_1_b_1"]
The test query_settings_index_application_aggregate.js expects that when using SBE, the hint will be ignored and the plan, regardless of the hint, will be IXSCAN main "a_1_b_1" → IndexedLoopJoin secondary "a_1_b_1"
This works on master because:
- We see $lookup → enable SBE
- As soon as we enable SBE, we call fillOutSecondaryCollectionsPlannerParams
- fillOutSecondaryCollectionsPlannerParams sets the flag params.querySettingsApplied
- When we call QueryPlanner::plan, it checks querySettingsApplied before applying the hint.
But if we enable featureFlagGetExecutorDeferredEngineChoice, we will be planning before we even know whether we'll be using SBE or not. Because of this, we'll call fillOutSecondaryCollectionsPlannerParams after we've already called QueryPlanner::plan and applied the hint for the main collection.
The plan is to only assert in the test not full plan equality, but if namespaces, affected by query settings have the correct indexes.