<!-- llms-explorer concept facts · https://llms-explorer.com/tree/performance-kb-articles/ · pack 2026-10-24 · ~1554 tokens -->

# Performance KB Articles

> Source-anchored research for Performance KB Articles. Run status: COMPLETED.

Parent: [MongoDB KB Articles](https://llms-explorer.com/tree/mongodb-kb-articles/) · 5 facets · 19 facts · page: https://llms-explorer.com/tree/performance-kb-articles/

## How it works

- When a sort lacks a supporting index, a compound index matching the filter and sort can reduce sorting work; compound-index field order matters for query efficiency. (medium confidence) — [source](https://www.mongodb.com/docs/v8.0/troubleshooting/slow-queries-in-production/)

## How-to and procedures

- Use explain execution statistics to compare document examination and index usage before and after a query or index change; a plan label alone is insufficient evidence of improvement. (high confidence) — [source](https://www.mongodb.com/docs/v8.0/troubleshooting/slow-queries-in-production/)
- Use $indexStats to investigate index usage, and hide suspected unnecessary indexes to evaluate query impact before dropping them. (medium confidence) — [source](https://www.mongodb.com/docs/manual/administration/query/)

## Problems, failure modes and limitations

- Start performance troubleshooting by comparing latency with a baseline, finding slow operations in logs or profiler data, and correlating them with resource saturation and recent deployment changes. (high confidence) — [source](https://www.mongodb.com/docs/manual/administration/query/)
- An index scan is not universally faster than a collection scan. MongoDB documents this limitation, and experiments on MongoDB 7.0.1 found index-scan preference in cases where collection scans ran faster. (high confidence) — [source](https://www.mongodb.com/docs/manual/administration/query/)
- Validate a fix by rerunning representative queries and comparing latency, documents examined, index usage, slow-operation evidence, and resource metrics against the previous baseline. (high confidence) — [source](https://www.mongodb.com/docs/v8.0/troubleshooting/slow-queries-in-production/)
- Diagnose slow operations with profiler or slow-query evidence, then inspect explain plans for the specific query; a generic recommendation to add indexes is insufficient. (high confidence) — [source](https://www.mongodb.com/docs/manual/administration/query/)

## Comparisons and alternatives

- Large index builds can interfere with normal operations. MongoDB recommends inspecting long-running operations and considering maintenance windows; SERVER-63095 supplies a historical user report of severe query slowdown during an index build, rather than proof that all builds cause such stalls. (medium confidence) — [source](https://www.mongodb.com/docs/v8.0/troubleshooting/slow-queries-in-production/)
- A collection scan is not automatically a performance defect: for some broad queries it can outperform an index scan, so judge measured work and latency rather than the presence of IXSCAN alone. (high confidence) — [source](https://www.mongodb.com/docs/manual/administration/query/)
- $indexStats usage counters are local to the node queried, count user-driven accesses rather than TTL maintenance, and reset on restart, index recreation, or index modification; zero accesses alone does not establish that an index is safe to drop. (medium confidence) — [source](https://www.mongodb.com/docs/manual/reference/operator/aggregation/indexStats/)
- For a support escalation, collect the complete query shape and options, expected versus observed latency, representative executionStats, logs, recent changes, resource metrics, and deployment topology. (low confidence) — [source](https://www.mongodb.com/docs/v8.0/troubleshooting/slow-queries-in-production/)

## Facts and statements

- Index design must balance read benefits with index maintenance on writes and storage costs; creating indexes for every field or query can degrade overall performance. (high confidence) — [source](https://www.mongodb.com/docs/manual/administration/query/)
- The 2024 First Past the Post study found an index-scan preference bias in experiments on MongoDB 7.0.1, including plans exceeding twice the runtime of the best tested alternative; this finding does not establish behavior in later releases. (low confidence) (verified as of 2024-09-25) — [source](https://arxiv.org/abs/2409.16544)
- The database profiler writes detailed operation data into system.profile and can add performance and disk overhead; assess those costs before production use. (low confidence) — [source](https://www.mongodb.com/docs/manual/administration/query/)
- Tencent describes plan drift as a performance regression where the query pattern stays unchanged but the selected index changes. Its examples connect drift to unrepresentative parameter values, changing data distributions, and cache re-evaluation. (low confidence) — [source](https://intl.cloud.tencent.com/document/product/240/81407)
- Treat cross-database benchmark rankings as workload-specific evidence: the stock-market study evaluated particular hybrid-cloud workloads, while a systematic review found that database performance studies often poorly reflect real use and omit replication detail. (medium confidence) — [source](https://arxiv.org/abs/2301.01095)
- mongo-perf describes itself as an internal MongoDB microbenchmark tool without support for external users, and warns that its legacy-shell dependency has no guaranteed forward compatibility. A performance KB should check compatibility before proposing it as a general diagnostic tool. (low confidence) (verified as of 2026-10-23) — [source](https://github.com/mongodb/mongo-perf)
- Compare latency with historical baselines or service objectives, correlate spikes with deployment changes and CPU, memory, or disk pressure, and verify fixes by rerunning representative queries. (low confidence) — [source](https://www.mongodb.com/docs/v8.0/troubleshooting/slow-queries-in-production/)
- An index scan can still be inefficient: compare examined keys and documents with returned results. Tencent documents indexed requests scanning roughly 1,500 entries to return only three documents. (high confidence) — [source](https://www.mongodb.com/docs/v8.0/troubleshooting/slow-queries-in-production/)
