diff options
author | Keith Bostic <keith@wiredtiger.com> | 2014-03-26 18:30:36 -0400 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2014-03-26 18:30:36 -0400 |
commit | 13ed1e44d2c91c4d4e863f87d62c8fb21b495903 (patch) | |
tree | 8de0fe36aa82b42b081a334c3694764672c2b3c5 /src/btree/bt_slvg.c | |
parent | bd351f2ce1d2e17550cd521b7c333df88ad0199c (diff) | |
download | mongo-13ed1e44d2c91c4d4e863f87d62c8fb21b495903.tar.gz |
A problem in the new-split branch is WT_REF structures remain with the
internal parent page, even when the tree deepens, and the memory
footprint of that page continues to increase even as the tree deepens.
The current algorithms go south: they view a large internal page as a
reason to deepen the tree, and no good comes the internal page never
decreasing in size.
A different approach: allocate WT_REF structures individually (even when
reading pages from disk), and move the memory footprint for the WT_REF
structures to the new children pages when the tree is deepened.
Diffstat (limited to 'src/btree/bt_slvg.c')
-rw-r--r-- | src/btree/bt_slvg.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/btree/bt_slvg.c b/src/btree/bt_slvg.c index 0349a991c43..5a14e2ee0de 100644 --- a/src/btree/bt_slvg.c +++ b/src/btree/bt_slvg.c @@ -1069,7 +1069,7 @@ __slvg_col_build_internal( WT_ADDR *addr; WT_DECL_RET; WT_PAGE *page; - WT_REF *ref; + WT_REF *ref,**refp; WT_TRACK *trk; uint32_t i; @@ -1081,7 +1081,10 @@ __slvg_col_build_internal( page->parent = NULL; /* Root page */ WT_ERR(__slvg_modify_init(session, page)); - for (ref = page->pg_intl_orig_index, i = 0; i < ss->pages_next; ++i) { + for (refp = + page->pg_intl_index->index, i = 0; i < ss->pages_next; ++i) { + ref = *refp++; + if ((trk = ss->pages[i]) == NULL) continue; @@ -1651,7 +1654,7 @@ __slvg_row_build_internal( WT_ADDR *addr; WT_DECL_RET; WT_PAGE *page; - WT_REF *ref; + WT_REF *ref, **refp; WT_TRACK *trk; uint32_t i; @@ -1663,7 +1666,10 @@ __slvg_row_build_internal( page->parent = NULL; WT_ERR(__slvg_modify_init(session, page)); - for (ref = page->pg_intl_orig_index, i = 0; i < ss->pages_next; ++i) { + for (refp = + page->pg_intl_index->index, i = 0; i < ss->pages_next; ++i) { + ref = *refp++; + if ((trk = ss->pages[i]) == NULL) continue; |