mongo
mongo copied to clipboard
SERVER-78113: not cache meaningless plan, it will increased memory overhead and increase computing overhead.
// when the mode is PlanCachingMode::AlwaysCache or PlanCachingMode::SometimesCache, there is a special case.
// take Classic plan cache for example:
// If the winning index's advanced = 0 && works == 1 && isEOF == true, which means we didn't get any data to rank score, all candidates
// score is same. the score of the calculation is meaningless.
//
//In this case, if we cache the plan, it will increased memory overhead. when the cached plan stage pick best plan,
//it will trigger replan. this will increase computing overhead.
https://jira.mongodb.org/browse/SERVER-78113