Bucket-level predicate rewriting for measurement operators
Parent: MongoDB Time-Series Query and Index Optimization · Published reference · snapshot 2026-10-22 · skill ranked-45864d99
↓ Facts as markdownall context files
Source-anchored research for Bucket-level predicate rewriting for measurement operators. 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
- MongoDB's 2026 SERVER-126494 report reproduces an incorrect result when a measurement field contains NaN and an aggregation applies $match {v: {$lt: 50}} followed by an inclusion $project: the regular collection returns {v: 1}, but the time-series collection returns no row. Jira lists 9.1.0-rc0 as the fix version. (low confidence) (verified as of 2026-09-29) [source]
How it works
- MongoDB Jira recorded historical false negatives when buckets mixed array and scalar values or mixed objects and non-objects on measurement paths; SERVER-59505 is marked fixed in 5.0.4, 5.1.0-rc3, and 5.2.0. SERVER-60565 describes splitting buckets when an incoming measurement has an incompatible schema. (high confidence) [source]
Problems, failure modes and limitations
- The generator declines object, array, and null operands; non-default-collation string comparisons; computed or removed fields; and non-time internal LT/LTE comparisons without type bracketing. When mixed schema cannot be ruled out, it adds a type-equality fallback across control.min/control.max path prefixes. SERVER-59505 records earlier false negatives when array/scalar or object/scalar values shared a bucket. (high confidence) (verified as of 2026-10-22) [source]
Comparisons and alternatives
- For non-time measurement fields, MongoDB treats the min/max predicate as a candidate filter rather than proof that every measurement matches. The generator disables a tight predicate because missing measurement values are omitted from control summaries and array-valued controls can change comparison semantics; MongoDB's query notes say individual measurements are still filtered after bucket selection. (high confidence) (verified as of 2026-10-22) [source]
Facts and statements
- Starting in MongoDB 6.0, a $match on a non-time measurement field can add a bucket filter to the COLLSCAN or FETCH: equality uses control.min <= value and control.max >= value; $gt/$gte compare against control.max; and $lt/$lte compare against control.min. (high confidence) (verified as of 2026-10-22) [source]
- For the special timeField path, the generator only uses the bucket comparison rewrite for BSON Date operands. A Stack Overflow explain example showed Date bounds generating control.min/control.max and _id constraints with IXSCAN, while numeric timestamp literals left an eventFilter and COLLSCAN; the answer attributes this to type-sensitive query semantics. (medium confidence) (verified as of 2025-12-24) [source]
- Independent writeups support the general summary-filtering design but differ in scope: OneUptime describes measurement-threshold indexes using control.min/control.max, while Percona's MongoDB 5.0 example shows the same summary-field filters for timestamp comparisons only. The Percona example is context for bucket pruning, not a test of measurement-field predicates. (medium confidence) [source]
- MongoDB's manual describes grouping by matching metaField values and nearby timeField values as a way to narrow queries to a range of buckets; measurement comparisons add a separate control-field filter in the query rewrite. (high confidence) [source]
Children
- Time-field bucket predicates (frontier)
- Mixed-schema measurement predicate safety (frontier)
- Loose versus tight bucket predicates (frontier)
Frontier under this node: Loose versus tight bucket predicates, Mixed-schema measurement predicate safety, Time-field bucket predicates