In case if several candidate plans achieved the same highest score, prefer a plan which fetches a smaller number of documents.
Implementation details:
In pickBestPlan function, right after we sort candidate plans:
1. Identified the tied plans
2. Compare the tied plans by number of examined documents
3. Increase score for the plan with fewer examined documents by epsilon value (which is defined above as a constant equals to 1e-4)
4. re-sort the plans
- duplicates
-
SERVER-14423 Plans which fetch different numbers of documents can tie
- Closed
-
SERVER-37194 Number of docsExamined is not considered for index selection
- Closed