-
Type: Bug
-
Resolution: Won't Do
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Query Planning
-
None
-
Query Optimization
-
ALL
-
This bug pertains specifically to the pure SBE subplanner. The code for the SBE subplanner still exists in the master branch. However, it was rendered unused by the work done in PM-3591 (Classic multi-planner with SBE). The affected code cannot be exercised in master and 8.0 unless featureFlagClassicRuntimePlanningForSbe is disabled.
Furthermore, this bug only applies for versions using the SBE plan cache. Since 6.0 does not use the SBE plan cache, 6.0 is also not affected.
This is a long way of saying that there is a bug on the 7.0 branch only, since in that branch we both use the pure SBE subplanner and the SBE plan cache. The correct caching behavior for the subplanner with the SBE plan cache is to create a plan cache entry for the entire plan. However, this code means that the implementation on 7.0 will actually create cache entries for each $or branch in addition to a cache entry for the entire query. I've demonstrated this behavior with a short JS repro script.
This isn't a query correctness problem, but it could lead to unnecessary cache bloat.
Also note that this problem will go away if we choose to backport PM-3591 to the 7.0 branch.