Include record headers when computing collection.stats().size

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Won't Fix
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Diagnostics, MMAPv1, Storage
    • None
    • Storage Execution
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      Right now we ignore records headers when computing collection data size (mongo/db/namespace_details.h):

      DiskLoc deletedList[Buckets];
      // ofs 168 (8 byte aligned)
      struct Stats {
          // datasize and nrecords MUST Be adjacent code assumes!
          long long datasize; // this includes padding, but not record headers
          long long nrecords;
      } stats;
      

      However, the value includes padding and also includes the alignment that we use in our storage engine.

      When the number of records hits 500,000,000 the headers overhead is 7+ GB, which is perceived as a lost disk space. I suggest to include record headers size into the coll.stats().size metric, or to introduce an additional sizeWithHeaders metric to avoid confusion.

            Assignee:
            [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            Alexander Komyagin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: