[DOCS-12652] [SERVER] Note addition of $sortKey metadata to projection of query by mongos Created: 25/Apr/19  Updated: 30/Oct/23  Resolved: 09/May/23

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Task Priority: Critical - P2
Reporter: Chris Harris Assignee: Unassigned
Resolution: Won't Do Votes: 2
Labels: ready-for-work, reopened
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by DOCS-4428 Queries executed via MongoS will alwa... Closed
Related
Participants:
Days since reply: 39 weeks, 1 day ago
Epic Link: DOCSP-26173
Story Points: 0.1

 Description   

Description

When a sort is requested for a query in a sharded cluster, the mongos will add a "$sortKey: {$meta: 'sortKey'}" entry to the projection that gets passed to the sharded mongod processes. Testing on 4.1.4 indicates that this is true for SINGLE_SHARD plans as well. This impacts how index filters get applied and should be taken into consideration when configuring them.

 This should be added to the planCacheSetFilter page. We can also consider adding it to the mongos "sharded cluster query router" page since there's a sorting section, although it currently only mentions the behavior when no sort is requested.

Scope of changes

Impact to Other Docs

MVP (Work and Date)

Resources (Scope or Design Docs, Invision, etc.)



 Comments   
Comment by Emet Ozar [ 09/May/23 ]

Query Team is hoping to deprecate index filters in favor of persisted query settings- see comments

Comment by Emet Ozar [ 09/May/23 ]

xiaochen.wu@mongodb.com Thank you! Closing.

Comment by Xiaochen Wu [ 09/May/23 ]

Discussed offline with Storch. I'm ok with closing this ticket. 

Comment by David Storch [ 09/May/23 ]

CC xiaochen.wu@mongodb.com given that Chris is out at the moment. Personally I'd be in favor of just closing this ticket as "Won't Do" given that the Query Team is hoping to deprecate index filters in favor of persisted query settings soon. See PM-412.

Comment by Emet Ozar [ 27/Oct/22 ]

christopher.harris@mongodb.com Hey Christopher, is this still relevant and needing to be fixed? Thank you, Emet CC: sarah.olson@mongodb.com ashley.brown@mongodb.com 

Comment by Chris Harris [ 26/Apr/19 ]

ravind.kumar this behavior should be present from 3.2 onwards, as indicated in this comment for a similar request for the pre-3.2 behavior.  Testing on 4.1 was to indicate that it is still present (with no plans for change as far as I'm aware).

Comment by Ravind Kumar (Inactive) [ 25/Apr/19 ]

christopher.harris you mentioned testing this in 4.1.X - is this only true in 4.1, or is this generally the behavior?

Generated at Thu Feb 08 08:05:46 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.