Add a new debug mode to WiredTiger that gathers statistics about page sizes

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • WT12.0.0
    • Affects Version/s: None
    • Component/s: Cursors, Statistics
    • None
    • Storage Engines - Persistence
    • 1,246.709
    • SE Persistence backlog
    • None

      MongoDB's collHash validation scans a collection's record store and indexes but does not run session->verify, so there is currently no free way to collect on-disk size information during that scan.

      This feature adds a cursor-open option, debug=(size_stats), that accumulates a per-b-tree size summary into new btree_size_* data-source statistics as the cursor traverses the tree. Accounting hooks the single per-page choke point in the tree walk, so it piggybacks on a scan the caller already performs rather than adding a pass. The results are read back with a statistics cursor.

      The summary records raw constituents only: per-page-type counts and uncompressed bytes, leaf key/value bytes and counts, overflow payloads, and a leaf page-size histogram, all derived from the on-disk image. Derived figures (overhead, totals) are left to the consumer.

      Scope/constraints:

      • Row-store only; returns EINVAL otherwise.
      • Kept deliberately separate from tree-walk statistics, which measure logical in-memory state from a dedicated walk.
      • Consumer (collHash) owns correct single-pass usage to avoid double-counting.

            Assignee:
            Luke Pearson
            Reporter:
            Luke Pearson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: