Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-1733

wt stat confusion for "number of key/value pairs"

    • Type: Icon: Task Task
    • Resolution: Done
    • WT2.5.2
    • Affects Version/s: None
    • Component/s: None

      After creating a btree with 279 entries, wt dump shows 279 entries, and wt stat reports 281 for btree: number of key/value pairs. The difference arises because entries in internal pages that point to subordinate pages are counted in this statistic. The btree for this case looks like this:

        Internal page
         /        \
      Leaf       Leaf

      We show:

        btree: number of key/value pairs=281
        btree: row-store internal pages=1
        btree: row-store leaf pages=2

      To get the "right" answer in a row store with current stat output, one needs to calculate: E - I - L + 1, where:

      E  == btree: number of key/value pairs
      I  == btree: row-store internal pages
      L  == btree: row-store leaf pages

      Or are there more factors to consider to get an accurate view? At any rate, this seems confusing and makes it harder to use wt stat as a quick diagnostic tool. It came up as part of SUPPORT-1248.

            donald.anderson@mongodb.com Donald Anderson
            donald.anderson@mongodb.com Donald Anderson
            0 Vote for this issue
            1 Start watching this issue