Deduplicate index size computation for logical size

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Logical size tracking currently computes per-collection index bytes through a dedicated path introduced in SERVER-128943. That path walks collections, fetches index idents from _mdb_catalog, and sums index size via storageEngine->getIndexStorageSize(...).

      We already have an existing collection-level implementation for index sizing in CollectionImpl::getIndexSize(). That implementation iterates the in-memory IndexCatalog (kReady | kUnfinished) and sums iam->getSpaceUsedBytes(...) for each index.

      Because logical size tracking is already a bounded approximation, we should reuse coll->getIndexSize() instead of maintaining a separate index-sizing path. This would reduce duplicate logic, align logical size with the existing collection stats implementation, and remove the need for the custom _mdb_catalog + getIndexStorageSize(...) path added in SERVER-128943.

            Assignee:
            Unassigned
            Reporter:
            Haley Connelly
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: