Description
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.
Attachments
Issue Links
- related to
-
WT-1752 Btree stats now report an accurate count of kv pairs in a btree.
- Closed