Atlas Query Targeting alerts
Parent: MongoDB Explain Plans, Query Planner and Plan Cache · Published reference · snapshot 2026-10-20 · skill ranked-e3681427
↓ Facts as markdownall context files
Source-anchored research for Atlas Query Targeting alerts. Run status: COMPLETED.
These notes link each claim to its source. Some citations identify archived research reports that are no longer hosted on this site. A published reference means the content is available; it does not certify independent review or accuracy.Read the editorial policy and follow the sources before relying on a claim.
Definitions
- A high ratio is a triage signal, not proof that the winning plan is wrong or that another index is always appropriate. A Stack Overflow aggregation example reports hundreds of thousands of matched documents reduced to seven bucket outputs, and a Reddit reply from a commenter who identifies as a MongoDB employee notes that a downstream $group can sharply reduce output and make a high ratio expected for some workflows. Check the query's work and per-stage explain statistics against its intended result before changing indexes. (medium confidence) [source]
Structure and components
- Work beyond ordinary application reads can contribute to Query Targeting ratios. Atlas documents that MongoDB Search (mongot) change-stream cursors can raise the ratio; a Meteor issue thread also contains user reports associating Atlas alerts with oplog tailing, so include background consumers when correlating an alert with workload activity. (medium confidence) [source]
How it works
- MongoDB says Query Targeting alerts commonly occur when no index supports a query or an existing index only partially supports it. Change-stream cursors used by MongoDB Search `mongot` to maintain Search indexes can also contribute to the Query Targeting ratio. (high confidence) [source]
- Datadog's Atlas integration lists `mongodb.atlas.querystats.docs_examined_ratio` and `mongodb.atlas.querystats.keys_examined_ratio` per query shape; when enabled on a supported M10+ cluster, these metrics provide a query-shape view that can help investigate an aggregate Atlas alert. (medium confidence) (verified as of 2026-10-14) [source]
Problems, failure modes and limitations
- One Query Targeting alert does not identify one triggering query: Atlas computes a sampled server-wide metric, while the Query Profiler shows operations that meet Atlas's slow-query criteria. Atlas warns that automatic thresholds can leave operations contributing to the ratio out of the logs. Correlate the alert window with historical metrics and logs, then inspect representative operations with cursor.explain(). (high confidence) (verified as of 2026-10-14) [source]
- Atlas warns that automatic slow-query thresholds can leave individual operations that contribute to Query Targeting ratios out of the logs or Query Profiler. A 2023 Atlas community thread reports the same symptom, so an empty profiler view does not establish that no operation contributed to the alert. (high confidence) (verified as of 2026-10-19) [source]
Comparisons and alternatives
- The alert reports scan-to-return counts rather than elapsed time. Percona's MongoDB comparison dashboard presents scan ratios separately from average operation latency; taken together, these sources support checking latency and workload data before treating a high ratio as the size of a user-visible slowdown. (medium confidence) [source]
Facts and statements
- Atlas defines two Query Targeting alert conditions: Scanned Objects / Returned compares documents scanned with documents returned, while Scanned / Returned compares index keys scanned with documents returned. Either condition might indicate a missing or inefficient index. (high confidence) [source]
- Atlas evaluates Scanned Objects / Returned using the ratio of average documents scanned to average documents returned across server operations during a sampling period; the documented default threshold is 1000:1. Scanned / Returned uses a user-defined threshold and is not enabled by default. (high confidence) (verified as of 2026-10-14) [source]
- Query Shape Reports can narrow an investigation after a Scanned Objects / Returned alert: current Atlas documentation limits automatic eligibility to dedicated M10-or-higher clusters running MongoDB 8.0 or later, and reports list up to five query shapes with at least 10 executions in the three-day reporting period. (high confidence) (verified as of 2026-10-14) [source]
- Atlas defines `Query Targeting: Scanned Objects / Returned` using documents scanned relative to documents returned, and `Query Targeting: Scanned / Returned` using index keys examined relative to documents returned. Atlas documentation reports a default 1000:1 threshold for the document-scan alert and says the index-key alert is not enabled by default. (high confidence) (verified as of 2026-10-19) [source]
- Atlas evaluates the default scanned-objects condition from the average documents scanned relative to the average documents returned server-wide across all operations during a sampling period; this alert is not a per-query ratio threshold. (high confidence) [source]
Children
- No children recorded.