[SERVER-8564] Clean up unneeded code for $natural hint overriding $natural sort Created: 14/Feb/13 Updated: 06/Dec/22 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Aaron Staple | Assignee: | Backlog - Query Optimization |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | neweng, query-44-grooming | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||||||||||
| Assigned Teams: |
Query Optimization
|
||||||||||||||||||||
| Backwards Compatibility: | Minor Change | ||||||||||||||||||||
| Participants: | |||||||||||||||||||||
| Description |
|
Right now the only way to return documents in natural order is to use a collection scan cursor (not an index cursor). And, currently, if both an index hint and natural ordering are specified for a query, the hint will supersede the natural ordering spec and the results will not be returned in natural order. Instead, hinting an index that cannot be used to retrieve results in natural order should produce an error. Test
|
| Comments |
| Comment by J Rassi [ 03/Feb/16 ] |
|
After we resolved this ticket, I found related code in query_planner.cpp that could use cleaning up. Re-opening this ticket to track that work. |
| Comment by Tess Avitabile (Inactive) [ 03/Feb/16 ] |
|
Hint no longer overrides natural sort. Now a hint that is inconsistent with a natural sort is an error. A hint is inconsistent with a natural sort if it uses an index or is a natural sort in the opposite direction. |
| Comment by Githook User [ 03/Feb/16 ] |
|
Author: {u'username': u'tessavitabile', u'name': u'Tess Avitabile', u'email': u'tess.avitabile@mongodb.com'}Message: SERVER-8564 An index hint inconsistent with requested natural order sort should be an error |
| Comment by Githook User [ 03/Feb/16 ] |
|
Author: {u'username': u'tessavitabile', u'name': u'Tess Avitabile', u'email': u'tess.avitabile@mongodb.com'}Message: SERVER-8564 Clean up CanonicalQuery::isValid() |
| Comment by Aaron Staple [ 18/Feb/13 ] |
|
Natural order is not the same as disk loc order. |
| Comment by Eliot Horowitz (Inactive) [ 18/Feb/13 ] |
|
Don't think this should error, should just use the index and then re-sort. |