serverStatus metrics.query.cbr
Parent: MongoDB Advanced Explain: Aggregation, Sharded Plans, Loose Index Scans and the 8.3 Cost-Based Ranker · Published reference · snapshot 2026-10-22 · skill ranked-5214f257
↓ Facts as markdownall context files
Source-anchored research for serverStatus metrics.query.cbr. 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.
How it works
- MongoDB's version-pinned 8.3 `serverStatus` reference documents `metrics.query.cbr` as the query-plan cost-based-ranker metrics object and marks its fields as new in 8.3.3. Percona independently describes the counters as a way to see when CBR ran and how often it won. (high confidence) (verified as of 2026-10-22) [source]
- `metrics.query.cbr.count` counts server uses of the cost-based ranker, while `metrics.query.cbr.choseWinningPlan` counts times the ranker chose a winning plan. Read them as separate invocation and win counters; Percona describes the same distinction as seeing when CBR was used and how often it won. (high confidence) (verified as of 2026-10-22) [source]
- Because serverStatus statistics reset when mongod restarts, monitor CBR invocation rates using count deltas over a fixed interval. MinervaDB illustrates subtracting two serverStatus snapshots and dividing the metrics.query.cbr.count delta by 60 seconds. (medium confidence) (verified as of 2026-10-22) [source]
- MinervaDB's example labels `metrics.query.cbr.count` as available since MongoDB 8.3, while MongoDB's 8.3 reference gives the patch-specific introduction as 8.3.3. Use 8.3.3 as the minimum documented version when checking field availability. (medium confidence) (verified as of 2026-10-22) [source]
Comparisons and alternatives
- MongoDB Jira reports that `numPlansTiedCostEstimation` once incremented both for tied plans and for plans rejected as more expensive, and lists the fix version as 8.3.3. The 8.3 reference marks the metric new in 8.3.3 and defines it as counting tied plans, so the sources place the correction at its documented introduction rather than showing an ongoing post-8.3.3 defect. (medium confidence) (verified as of 2026-09-20) [source]
Facts and statements
- The reference defines `metrics.query.cbr.micros` as total CBR time including sampling and ranking, and `samplingMicros` as sampling time. `numPlans` counts candidate plans; the `histograms` subfields expose distributions for total time, sampling time, and candidate-plan count. MinervaDB's monitoring guide independently identifies CBR invocation counts, ranking time, and candidate-plan counts as useful monitoring data. (medium confidence) (verified as of 2026-10-22) [source]
- metrics.query.cbr.numPlans counts candidate plans compared; numPlansFailedCostEstimation and numPlansTiedCostEstimation count candidate plans whose costs could not be estimated or tied. (low confidence) [source]
Children
- No children recorded.