<!-- llms-explorer concept facts · https://llms-explorer.com/tree/metafield-cardinality-and-active-bucket-count/ · pack 2026-10-23 · ~1259 tokens -->

# metaField cardinality and active-bucket count

> Source-anchored research for metaField cardinality and active-bucket count. Run status: COMPLETED.

Parent: [Bucket catalog memory and closure reasons](https://llms-explorer.com/tree/bucket-catalog-memory-and-closure-reasons/) · 4 facets · 9 facts · page: https://llms-explorer.com/tree/metafield-cardinality-and-active-bucket-count/

## How it works

- The BucketCatalog's open-bucket set is a runtime set, not the collection's historical bucket count. MongoDB's server README says it maintains open buckets and has an invariant of at most one open bucket per unique meta value. Therefore, high cardinality raises the potential open-bucket count when more distinct metadata values receive writes concurrently, while historical metadata values alone do not imply that an open bucket exists. (high confidence) (verified as of 2026-10-20) — [source](https://github.com/mongodb/mongo/blob/master/src/mongo/db/timeseries/README.md)
- When BucketCatalog memory exceeds its threshold, MongoDB archives or closes idle open buckets. Archiving removes most of a bucket's in-memory catalog state but retains a small record for reopening; if memory remains over the threshold, MongoDB also removes archived entries. This makes the runtime active-bucket count sensitive to catalog memory pressure and bucket state. (high confidence) (verified as of 2026-10-20) — [source](https://github.com/mongodb/mongo/blob/master/src/mongo/db/timeseries/README.md)

## Problems, failure modes and limitations

- A MongoDB Community user reported slow inserts with roughly 100–1000 metaField series identifiers. The same workload also had batches that could arrive out of global time order and many measurement fields, so the report does not isolate cardinality as the cause. (low confidence) — [source](https://www.mongodb.com/community/forums/t/time-series-inserts-unreasonably-slow/217400)

## Comparisons and alternatives

- MongoDB groups measurements into a bucket only when their metaField values match and their timeField values are close. Its manual says bucket count depends on the number of unique metaField values and that fine-grained or dynamic values can produce sparse, short-lived buckets with lower storage and query efficiency. This is a scoped risk rather than a universal failure rule: the manual also says compressed time-series workloads can support high cardinality. (high confidence) (verified as of 2026-10-14) — [source](https://www.mongodb.com/docs/manual/core/timeseries/timeseries-bucketing.md)
- SERVER-89233 recorded a cache-pressure bug in MongoDB 7.0.4/7.0.5 where bucket count could equal document count regardless of granularity or metaField settings. Jira lists fixes in 8.0.5 and 8.1.0-rc0, so this is a resolved version-specific anomaly rather than a general cardinality rule. (low confidence) (verified as of 2025-04-25) — [source](https://jira.mongodb.org/browse/SERVER-89233)
- Percona's October 20, 2021 MongoDB 5.0 example reused three stock metadata values across minute-by-minute measurements and reported totalSize of 5,357,568 bytes for the time-series collection versus 21,934,080 bytes for a regular collection, about a 4.1x difference. The test did not vary metadata cardinality, and its regular-collection comparison had no secondary index, so it does not establish a general cardinality threshold. (low confidence) (verified as of 2021-10-20) — [source](https://www.percona.com/blog/mongodb-5-0-time-series-collections/)

## Facts and statements

- MongoDB's server README defines an active bucket as either open or archived. An archived bucket remains on disk with a small in-memory catalog record, while a closed bucket exists only on disk. Thus the active-bucket count includes buckets that are not open for immediate writes and does not equal the number of full bucket payloads resident in memory. (high confidence) (verified as of 2026-10-20) — [source](https://github.com/mongodb/mongo/blob/master/src/mongo/db/timeseries/README.md)
- Percona's historical MongoDB 5.0 example describes metaField as optional series metadata that may be a scalar or object and reuses metadata objects to distinguish stock streams. This illustrates metaField as series identity, but it does not measure current BucketCatalog or active-bucket counts. (medium confidence) — [source](https://www.percona.com/blog/mongodb-5-0-time-series-collections/)
- MongoDB's implementation README states that the BucketCatalog maintains at most one open bucket per unique meta value, but defines an active bucket as either open or archived. Archived entries retain a small in-memory record, while fully closed buckets exist only on disk. Therefore unique metaField count, open-bucket count, active-catalog bucket count, and total stored bucket-document count are different measures; unique metaField count alone is not an exact active-catalog count. (high confidence) (verified as of 2026-10-20) — [source](https://github.com/mongodb/mongo/blob/master/src/mongo/db/timeseries/README.md)
