[SERVER-17815] Plan ranking tie breaker is computed incorrectly Created: 31/Mar/15 Updated: 19/Sep/15 Resolved: 29/Jun/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 2.6.10, 3.0.4 |
| Fix Version/s: | 2.6.11, 3.0.5, 3.1.6 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | David Storch | Assignee: | David Storch |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Backport Completed: | |||||||||
| Sprint: | Quint Iteration 3.1.2, Quint Iteration 6 | ||||||||
| Participants: | |||||||||
| Description |
|
The epsilon value used to break a tie is computed as 1 over the query knob constant for the max number of works to perform during plan ranking: https://github.com/mongodb/mongo/blob/r3.1.0/src/mongo/db/query/plan_ranker.cpp#L209-L211
During plan ranking, however, the actual number of works is the max of internalQueryPlanEvaluationWorks and some fixed fraction of the collection size: https://github.com/mongodb/mongo/blob/r3.1.0/src/mongo/db/exec/multi_plan.cpp#L199-L200
The consequence is that the tie breaker can be too large. Instead of breaking a tie, it can cause an inferior plan's score to exceed a superior plan's score. |
| Comments |
| Comment by Githook User [ 29/Jun/15 ] |
|
Author: {u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}Message: (cherry picked from commit dcc38a627d3e4f92d9df0eaeb97739dfa0280907) |
| Comment by Githook User [ 29/Jun/15 ] |
|
Author: {u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}Message: (cherry picked from commit dcc38a627d3e4f92d9df0eaeb97739dfa0280907) |
| Comment by Githook User [ 29/Jun/15 ] |
|
Author: {u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}Message: |
| Comment by David Storch [ 29/Jun/15 ] |
|
The original fix for this problem, released with 2.6.10 and 3.0.3, was discovered to be incorrect. The user impact is that the plan ranking problem can still occur on all stable versions of the server. Re-opening pending an additional fix. |
| Comment by Githook User [ 10/Apr/15 ] |
|
Author: {u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}Message: (cherry picked from commit 122ceeaf9caca8ac1a93e1bed1a7286315aee0ab) |
| Comment by Githook User [ 10/Apr/15 ] |
|
Author: {u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}Message: (cherry picked from commit 122ceeaf9caca8ac1a93e1bed1a7286315aee0ab) |
| Comment by Githook User [ 07/Apr/15 ] |
|
Author: {u'username': u'dstorch', u'name': u'David Storch', u'email': u'david.storch@10gen.com'}Message: |