diff options
author | Keith Bostic <keith@wiredtiger.com> | 2012-10-11 12:34:20 +0000 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2012-10-11 12:34:20 +0000 |
commit | cc5abbc0ce112e3261d322f4b42f21b7bb854ae0 (patch) | |
tree | edbfe1d73019b8c782cce736a730d643c1c2e232 /src/btree/bt_curnext.c | |
parent | d4e4f93aa0d87fee6f6a66490a19c1a454f7ff5c (diff) | |
download | mongo-cc5abbc0ce112e3261d322f4b42f21b7bb854ae0.tar.gz |
The __wt_cell_unpack_copy function copies the key/value sometimes but
not always (and it's worse now that we can do look-aside into the
reconciliation tracking buffer for variable-length column-store overflow
values). Add a new function, __wt_cell_unpack_ref that always tries to
avoid copying, change __wt_cell_unpack_copy to always copy, and update
callers that don't need a copy to call the new function.
Diffstat (limited to 'src/btree/bt_curnext.c')
-rw-r--r-- | src/btree/bt_curnext.c | 43 |
1 files changed, 16 insertions, 27 deletions
diff --git a/src/btree/bt_curnext.c b/src/btree/bt_curnext.c index c4f64115390..d08f113fd90 100644 --- a/src/btree/bt_curnext.c +++ b/src/btree/bt_curnext.c @@ -218,34 +218,23 @@ new_page: /* Find the matching WT_COL slot. */ if ((cell = WT_COL_PTR(cbt->page, cip)) == NULL) continue; __wt_cell_unpack(cell, &unpack); - switch (unpack.type) { - case WT_CELL_DEL: + if (unpack.type == WT_CELL_DEL) continue; - case WT_CELL_VALUE: - if (session->btree->huffman_value == NULL) { - cbt->tmp.data = unpack.data; - cbt->tmp.size = unpack.size; - break; - } - /* FALLTHROUGH */ - default: - /* - * Restart for a variable-length column-store. - * We could catch restart higher up the call- - * stack but there's no point to it: unlike - * row-store (where the normal search path finds - * cached overflow values), we have to access - * the page's reconciliation structures, and - * that's as easily done here as higher up the - * stack. - */ - if ((ret = __wt_cell_unpack_copy( - session, &unpack, &cbt->tmp)) == WT_RESTART) - ret = __wt_ovfl_cache_col_restart( - session, - cbt->page, &unpack, &cbt->tmp); - WT_RET(ret); - } + + /* + * Restart for a variable-length column-store. We could + * catch restart higher up the call-stack but there's no + * point to it: unlike row-store (where a normal search + * path finds cached overflow values), we have to access + * the page's reconciliation structures, and that's as + * easy here as higher up the stack. + */ + if ((ret = __wt_cell_unpack_ref( + session, &unpack, &cbt->tmp)) == WT_RESTART) + ret = __wt_ovfl_cache_col_restart( + session, cbt->page, &unpack, &cbt->tmp); + WT_RET(ret); + cbt->cip_saved = cip; } val->data = cbt->tmp.data; |