Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-12946

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

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Won't Fix
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Diagnostics, MMAPv1, Storage
    • None
    • Storage Execution

    Description

      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.

      Attachments

        Activity

          People

            backlog-server-execution Backlog - Storage Execution Team
            alex.komyagin@mongodb.com Alexander Komyagin
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: