-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Execution
-
Fully Compatible
-
ALL
-
-
QE 2024-11-25
Clustered index scans is not a separate stage, but a sub-set of Collection scans, so we usually decide if the specific plan a collscan or a clustered index scan based on min/max fields:
https://github.com/mongodb/mongo/blob/18b4c3934ec251acf7d34fbfc3db8957fb6acb96/src/mongo/db/exec/collection_scan.cpp#L87
https://github.com/mongodb/mongo/blob/18b4c3934ec251acf7d34fbfc3db8957fb6acb96/src/mongo/db/query/query_solution.cpp#L386
https://github.com/mongodb/mongo/blob/18b4c3934ec251acf7d34fbfc3db8957fb6acb96/src/mongo/db/query/plan_explainer_sbe.cpp#L110
But when generating a planSummary for SBE we don't have this check:
https://github.com/mongodb/mongo/blob/18b4c3934ec251acf7d34fbfc3db8957fb6acb96/src/mongo/db/query/query_solution.cpp#L257
This can cause confuse people, so we should fix this.
Bonus assignment: think of how we can avoid such bugs in the future.