Atlas Query Shape Insights
Parent: MongoDB Explain Plans, Query Planner and Plan Cache · Published reference · snapshot 2026-10-23 · skill mongodb-cohort-2b640565deb6-pending
↓ Facts as markdown↓ Portable .llms packagent context libraries
Source-anchored research for Atlas Query Shape Insights. 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.
Structure and components
- Percona advises checking tooling that consumes $queryStats before upgrading to MongoDB 9.0, because the structure and serialization of the output changed. Percona also notes that in 9.0 $queryStats covers inserts, updates and deletes, and that looking only at reads can miss write-heavy workloads. Separately, Atlas documents that on MongoDB 8.x clusters Query Shape Insights records only reads and does not collect write operations, while on 9.0 or later it samples reads and writes. Sources: https://www.percona.com/blog/mongodb-9-0-more-8-4-than-9-0/ ; https://www.mongodb.com/docs/atlas/query-shape-insights.md [source 1] [source 2]
How it works
- An 8.x-to-9.0 upgrade can change Query Shape Insights totals because the collection method changes. Datadog query-shape metrics expose samplingstrategy and samplingrate tags to distinguish rate-limited collection from random sampling. (medium confidence) (verified as of 2026-10-14) Sources: https://www.mongodb.com/docs/atlas/query-shape-insights.md ; https://docs.datadoghq.com/integrations/mongodb-atlas [source 1] [source 2]
- The Query Shape Insights summaries API deprecates P50/P90/P99 execution-time series and fields because values may be inaccurate. [redacted] explains that deriving percentiles from lastExecMicros was incorrect and requests native execution-time histograms. Do not treat these legacy percentiles as reliable latency distributions. (high confidence) (verified as of 2026-10-23) Sources: https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-listgroupclusterqueryshapeinsightsummaries ; https://jira.mongodb.org/browse/SERVER-126327 [source 1] [source 2] [source 3]
- The MongoDB query-stats implementation groups executions in a partitioned hash table (the QueryStatsStore) whose key has dimensions beyond query shape; the $queryStats statistics are held in an in-memory virtual collection. Specifying batchSize creates a separate store entry even when the query shape is the same, and each partition is an LRU cache that evicts the least recently used entries when over its size limit. Sources: https://github.com/mongodb/mongo/blob/master/src/mongo/db/query/query_stats/README.md ; https://www.mongodb.com/docs/manual/reference/operator/aggregation/queryStats.md [source 1] [source 2]
Measurements and reference values
- Collection is version-dependent: Atlas 8.x records up to 100 read queries per second per host and excludes writes; Atlas 9.0+ randomly samples 1% of reads and writes by default. Values describe collected operations, not complete workload totals, and rare shapes may be absent. (high confidence) (verified as of 2026-10-14) [source 1] [source 2]
Problems, failure modes and limitations
- Atlas Query Shape Insights reports metrics per query shape and ranks the top shapes by total execution time. After using it, users can pivot to Query Profiler, pre-filtered to the collection and operation type, for more detail on individual queries. Use the shape view to prioritize workload patterns, then investigate individual operations. Sources: https://www.mongodb.com/docs/atlas/query-shape-insights.md ; https://mongodb.com/company/blog/product-release-announcements/introducing-query-shape-insights-in-mongodb-atlas [source 1] [source 2] [source 3] [source 4]
Comparisons and alternatives
- Atlas documents warn that field names in redacted query shapes can still contain PII. Users without the specified roles see query shape hashes instead of truncated or full shapes. (low confidence) (verified as of 2026-10-14) [source]
Facts and statements
- Query Shape Insights requires an Atlas dedicated cluster (M10 or above) running MongoDB 8.0 or later. The documented analysis window is seven days, with up to five shapes charted at once. (high confidence) (verified as of 2026-10-14) [source 1] [source 2]
- The Atlas Datadog integration exports query-shape metrics, including execution count, execution time and documents examined/returned. Operators enable query-shape metrics in Atlas Datadog Settings and can correlate exported metrics using the queryshapehash tag. (high confidence) (verified as of 2026-10-14) Sources: https://docs.datadoghq.com/integrations/mongodb-atlas ; https://mongodb.com/company/blog/product-release-announcements/analyze-query-shapes-with-mongodb-datadog [source 1] [source 2] [source 3]
- The summaries endpoint supports programmatic retrieval of query-shape statistics. MongoDB describes a workflow that pivots from shape-level findings to Query Profiler with collection and operation filters, then to Performance Advisor for index recommendations. (medium confidence) (verified as of 2026-10-23) Sources: https://www.mongodb.com/docs/api/doc/atlas-admin-api-v2/operation/operation-listgroupclusterqueryshapeinsightsummaries ; https://mongodb.com/company/blog/product-release-announcements/introducing-query-shape-insights-in-mongodb-atlas [source 1] [source 2] [source 3]
Children
- Query shape hash correlation (frontier)
- Query-shape metric sampling (frontier)
- Execution-time percentile accuracy (frontier)
Frontier under this node: Execution-time percentile accuracy, Query shape hash correlation, Query-shape metric sampling