[DOCS-16102] [Atlas Search] Add limit pushdown info to explain output Created: 09/May/23  Updated: 29/Oct/23  Resolved: 26/Jul/23

Status: Closed
Project: Documentation
Component/s: Atlas, FTS
Affects Version/s: None
Fix Version/s: 7.1.0-rc0, 6.0.7, 7.0.0-rc3, 5.0.20

Type: Task Priority: Major - P3
Reporter: Backlog - Core Eng Program Management Team Assignee: Kanchana Sekhar
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
documents SERVER-75648 Add limit pushdown info to explain ou... Closed
Duplicate
is duplicated by DOCS-16173 [BACKPORT] [v6.0] Add limit pushdown ... Closed
is duplicated by DOCS-16174 [BACKPORT] [v7.0] Add limit pushdown ... Closed
Participants:
Days since reply: 28 weeks ago

 Description   
Original Downstream Change Summary

This ticket adds a 'mongotDocsRequested' field to the explain output of the '$_internalSearchMongotRemote' stage.

Description of Linked Ticket

Add some form of the information regarding the limit that was pushed down in the explain output for the $_internalSearchMongotRemote stage



 Comments   
Comment by Kanchana Sekhar [ 26/Jul/23 ]

Atlas Search PR: https://github.com/10gen/cloud-docs/pull/4736

Comment by Kanchana Sekhar [ 25/Jul/23 ]

PR: https://github.com/10gen/cloud-docs/pull/4736

Comment by Ben Shteinfeld [ 18/Jul/23 ]

SERVER-75648 was part of an optimization in the protocol between mongod and mongot to have mongot avoid doing potentially unnecessary work when the query specifies a limit. The optimization adds a bit to mongod's request to mongot which specifies a requested number of documents it wants from mongot - allowing mongot to avoiding ranking documents that the query doesn't need. However, $idLookup might filter out some results, so this new bit is just a suggestion to mongot, rather than a hard requirement (as opposed to limit pushdown from mongos to mongod).

This ticket is particular adds this bit, named 'mongotDocsRequested', to the explain output of $_internalSearchMongotRemote which represents the number of documents that mongod requested from mongot. Note this is a query planning metric, not an execution time metric - mongot might end up returning more or fewer documents than were requested.

Example explain:

{
   "mongotQuery": {},
   "explain": {},
   "limit": <int>,
   "sortSpec": {},
   "mongotDocsRequested": <int>,
}

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