[SERVER-55418] report docsExamined for $search queries Created: 22/Mar/21 Updated: 27/Dec/23 |
|
| Status: | Backlog |
| Project: | Core Server |
| Component/s: | Logging |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Harshad Dhavale | Assignee: | Backlog - Query Integration |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | qi-search | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||
| Assigned Teams: |
Query Integration
|
||||
| Operating System: | ALL | ||||
| Steps To Reproduce: |
|
||||
| Participants: | |||||
| Description |
|
------------------------ Note: As this pertains to logging queries in the mongod log, I have filed this under the JIRA under the SERVER project. If this is incorrect, please move to the appropriate project. When you run an Atlas Search query that has $search and another stage following it (such as $match), the corresponding entry that gets logged for it in the mongod logs and which gets captured in the Atlas Profiler appears to be inaccurate, and it shows:
The "keysExamined": 0 makes sense, because no MongoDB index is used for the query. However, the "docsExamined": 0 is incorrect because, AFAIK, when you run an Atlas Search query, the mongod makes an API call to the mongot which returns the objectId and metada for the matched documents back to mongod. Then mongod will then fetch those documents that match that objectId and metadata, and return them to the user. Ergo, "docsExamined" should not be 0. Also, the "numYields", which is a counter that reports the number of times the operation has yielded to allow other operations to complete, appears to be 0 even for long running operations, which does not seem accurate. Note: The keysExamined and docsExamined appear only in the entries logged in the mongod log and the Profiler, for the Atlas Search query. If you run an explain plan with executionStats or allPlansExecution, it will not show the aforementioned metrics. ------------------------ 1. I set my cluster's profiling level to capture all queries in the mongod logs.
3. The above generated the following entry in the mongod log as well as the Profiler:
4. I ran explain("executionStats") which did not have keysExamined and docsExamined:
|
| Comments |
| Comment by Katya Kamenieva [ 31/Mar/21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I see the same with just $search stage without following $match. Should it be different with $match and without?
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Kyle Suarez [ 30/Mar/21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
kateryna.kamenieva and marcus.eagan, could you please comment on the relative priority of this compared to the rest of the Query Execution projects? | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marcus Eagan (Inactive) [ 22/Mar/21 ] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
cc doug.tarr |