summaryrefslogtreecommitdiff
path: root/src/btree/bt_page.c
diff options
context:
space:
mode:
authorKeith Bostic <keith@wiredtiger.com>2015-11-21 11:13:44 -0500
committerKeith Bostic <keith@wiredtiger.com>2015-11-21 11:13:44 -0500
commit26f57cfd97eba14b7367e2be6ccc60e93f9dc3a0 (patch)
treebae043cb6c55e26a52b719ccd8d455b244603393 /src/btree/bt_page.c
parent5d921238fa9eb940f76238a592981bddf9ec711f (diff)
downloadmongo-26f57cfd97eba14b7367e2be6ccc60e93f9dc3a0.tar.gz
WT-2231: When internal pages into memory and creating the underlying
WT_REF structures, set the page-index hint, it's easy and we know it.
Diffstat (limited to 'src/btree/bt_page.c')
-rw-r--r--src/btree/bt_page.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/btree/bt_page.c b/src/btree/bt_page.c
index 8808f0b1a85..fdccf033828 100644
--- a/src/btree/bt_page.c
+++ b/src/btree/bt_page.c
@@ -272,7 +272,7 @@ __inmem_col_int(WT_SESSION_IMPL *session, WT_PAGE *page)
const WT_PAGE_HEADER *dsk;
WT_PAGE_INDEX *pindex;
WT_REF **refp, *ref;
- uint32_t i;
+ uint32_t hint, i;
btree = S2BT(session);
dsk = page->dsk;
@@ -284,9 +284,11 @@ __inmem_col_int(WT_SESSION_IMPL *session, WT_PAGE *page)
*/
pindex = WT_INTL_INDEX_GET_SAFE(page);
refp = pindex->index;
+ hint = 0;
WT_CELL_FOREACH(btree, dsk, cell, unpack, i) {
ref = *refp++;
ref->home = page;
+ ref->pindex_hint = hint++;
__wt_cell_unpack(cell, unpack);
ref->addr = cell;
@@ -404,7 +406,7 @@ __inmem_row_int(WT_SESSION_IMPL *session, WT_PAGE *page, size_t *sizep)
const WT_PAGE_HEADER *dsk;
WT_PAGE_INDEX *pindex;
WT_REF *ref, **refp;
- uint32_t i;
+ uint32_t hint, i;
bool overflow_keys;
btree = S2BT(session);
@@ -421,9 +423,11 @@ __inmem_row_int(WT_SESSION_IMPL *session, WT_PAGE *page, size_t *sizep)
pindex = WT_INTL_INDEX_GET_SAFE(page);
refp = pindex->index;
overflow_keys = false;
+ hint = 0;
WT_CELL_FOREACH(btree, dsk, cell, unpack, i) {
ref = *refp;
ref->home = page;
+ ref->pindex_hint = hint++;
__wt_cell_unpack(cell, unpack);
switch (unpack->type) {