diff options
author | Keith Bostic <keith@wiredtiger.com> | 2015-02-02 17:13:09 -0500 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2015-02-02 17:13:09 -0500 |
commit | 8545c4b3b7f5ed306215c82f1ad1cbe3664f0c50 (patch) | |
tree | 8c68cc1d0b3a021132c17cc4f2b09ea6d297fe46 | |
parent | 70e218d9f3803ac106056e79268bb80c79769dea (diff) | |
download | mongo-8545c4b3b7f5ed306215c82f1ad1cbe3664f0c50.tar.gz |
Make the "split to deepen the tree" configuration values real, stored
in the metadata file, but they remain undocumented for now.
-rw-r--r-- | dist/api_data.py | 6 | ||||
-rw-r--r-- | src/btree/bt_handle.c | 16 | ||||
-rw-r--r-- | src/btree/bt_split.c | 15 | ||||
-rw-r--r-- | src/config/config_def.c | 11 | ||||
-rw-r--r-- | src/include/btree.h | 23 |
5 files changed, 50 insertions, 21 deletions
diff --git a/dist/api_data.py b/dist/api_data.py index 7754a3a1d13..65af833c4a2 100644 --- a/dist/api_data.py +++ b/dist/api_data.py @@ -241,6 +241,12 @@ file_config = format_meta + [ minimum gain before prefix compression will be used on row-store leaf pages''', min=0), + Config('split_deepen_min_child', '0', r''' + minimum entries in a page to consider deepening the tree''', + type='int', undoc=True), + Config('split_deepen_per_child', '0', r''' + entries allocated per child when deepening the tree''', + type='int', undoc=True), Config('split_pct', '75', r''' the Btree page split size as a percentage of the maximum Btree page size, that is, when a Btree page is split, it will be diff --git a/src/btree/bt_handle.c b/src/btree/bt_handle.c index f0414c4e855..14d16afb9a3 100644 --- a/src/btree/bt_handle.c +++ b/src/btree/bt_handle.c @@ -676,6 +676,22 @@ __btree_page_sizes(WT_SESSION_IMPL *session) leaf_split_size = __wt_split_page_size(btree, btree->maxleafpage); /* + * In-memory split configuration. + */ + if (__wt_config_gets( + session, cfg, "split_deepen_min_child", &cval) == WT_NOTFOUND || + cval.val == 0) + btree->split_deepen_min_child = WT_SPLIT_DEEPEN_MIN_CHILD_DEF; + else + btree->split_deepen_min_child = (u_int)cval.val; + if (__wt_config_gets( + session, cfg, "split_deepen_per_child", &cval) == WT_NOTFOUND || + cval.val == 0) + btree->split_deepen_per_child = WT_SPLIT_DEEPEN_PER_CHILD_DEF; + else + btree->split_deepen_per_child = (u_int)cval.val; + + /* * Get the maximum internal/leaf page key/value sizes. * * In historic versions of WiredTiger, the maximum internal/leaf page diff --git a/src/btree/bt_split.c b/src/btree/bt_split.c index e4fe51ea28f..aa7fc011cd8 100644 --- a/src/btree/bt_split.c +++ b/src/btree/bt_split.c @@ -169,13 +169,6 @@ __split_safe_free(WT_SESSION_IMPL *session, int exclusive, void *p, size_t s) } /* - * Tuning; global variables to allow the binary to be patched, we don't yet have - * any real understanding of what might be useful to surface to applications. - */ -static u_int __split_deepen_min_child = 10000; -static u_int __split_deepen_per_child = 100; - -/* * __split_should_deepen -- * Return if we should deepen the tree. */ @@ -183,11 +176,13 @@ static int __split_should_deepen( WT_SESSION_IMPL *session, WT_REF *ref, uint32_t *childrenp) { - WT_PAGE_INDEX *pindex; + WT_BTREE *btree; WT_PAGE *page; + WT_PAGE_INDEX *pindex; *childrenp = 0; + btree = S2BT(session); page = ref->page; pindex = WT_INTL_INDEX_COPY(page); @@ -204,8 +199,8 @@ __split_should_deepen( * we get a significant payback (in the case of a set of large keys, * splitting won't help). */ - if (pindex->entries > __split_deepen_min_child) { - *childrenp = pindex->entries / __split_deepen_per_child; + if (pindex->entries > btree->split_deepen_min_child) { + *childrenp = pindex->entries / btree->split_deepen_per_child; return (1); } diff --git a/src/config/config_def.c b/src/config/config_def.c index 646551cdd38..a7e9419a65c 100644 --- a/src/config/config_def.c +++ b/src/config/config_def.c @@ -152,6 +152,8 @@ static const WT_CONFIG_CHECK confchk_file_meta[] = { { "os_cache_max", "int", "min=0", NULL }, { "prefix_compression", "boolean", NULL, NULL }, { "prefix_compression_min", "int", "min=0", NULL }, + { "split_deepen_min_child", "int", NULL, NULL }, + { "split_deepen_per_child", "int", NULL, NULL }, { "split_pct", "int", "min=25,max=100", NULL }, { "value_format", "format", NULL, NULL }, { "version", "string", NULL, NULL }, @@ -246,6 +248,8 @@ static const WT_CONFIG_CHECK confchk_session_create[] = { { "prefix_compression", "boolean", NULL, NULL }, { "prefix_compression_min", "int", "min=0", NULL }, { "source", "string", NULL, NULL }, + { "split_deepen_min_child", "int", NULL, NULL }, + { "split_deepen_per_child", "int", NULL, NULL }, { "split_pct", "int", "min=25,max=100", NULL }, { "type", "string", NULL, NULL }, { "value_format", "format", NULL, NULL }, @@ -585,7 +589,8 @@ static const WT_CONFIG_ENTRY config_entries[] = { ",key_format=u,key_gap=10,leaf_item_max=0,leaf_key_max=0," "leaf_page_max=32KB,leaf_value_max=0,memory_page_max=5MB," "os_cache_dirty_max=0,os_cache_max=0,prefix_compression=0," - "prefix_compression_min=4,split_pct=75,value_format=u," + "prefix_compression_min=4,split_deepen_min_child=0," + "split_deepen_per_child=0,split_pct=75,value_format=u," "version=(major=0,minor=0)", confchk_file_meta }, @@ -626,8 +631,8 @@ static const WT_CONFIG_ENTRY config_entries[] = { "bloom_hash_count=8,bloom_oldest=0,chunk_max=5GB,chunk_size=10MB," "merge_max=15,merge_min=0),memory_page_max=5MB," "os_cache_dirty_max=0,os_cache_max=0,prefix_compression=0," - "prefix_compression_min=4,source=,split_pct=75,type=file," - "value_format=u", + "prefix_compression_min=4,source=,split_deepen_min_child=0," + "split_deepen_per_child=0,split_pct=75,type=file,value_format=u", confchk_session_create }, { "session.drop", diff --git a/src/include/btree.h b/src/include/btree.h index fa01dd5edc2..dd3acf6940d 100644 --- a/src/include/btree.h +++ b/src/include/btree.h @@ -98,14 +98,21 @@ struct __wt_btree { CKSUM_UNCOMPRESSED=3 /* Uncompressed blocks only */ } checksum; /* Checksum configuration */ - u_int dictionary; /* Reconcile: dictionary slots */ - int internal_key_truncate; /* Reconcile: internal key truncate */ - int maximum_depth; /* Reconcile: maximum tree depth */ - int prefix_compression; /* Reconcile: prefix compression */ - u_int prefix_compression_min; /* Reconcile: prefix compression min */ - int split_pct; /* Reconcile: split page percent */ - WT_COMPRESSOR *compressor; /* Reconcile: page compressor */ - WT_RWLOCK *ovfl_lock; /* Reconcile: overflow lock */ + /* + * Reconciliation... + */ + u_int dictionary; /* Dictionary slots */ + int internal_key_truncate; /* Internal key truncate */ + int maximum_depth; /* Maximum tree depth */ + int prefix_compression; /* Prefix compression */ + u_int prefix_compression_min; /* Prefix compression min */ +#define WT_SPLIT_DEEPEN_MIN_CHILD_DEF 10000 + u_int split_deepen_min_child; /* Minimum entries to deepen tree */ +#define WT_SPLIT_DEEPEN_PER_CHILD_DEF 100 + u_int split_deepen_per_child; /* Entries per child when deepened */ + int split_pct; /* Split page percent */ + WT_COMPRESSOR *compressor; /* Page compressor */ + WT_RWLOCK *ovfl_lock; /* Overflow lock */ uint64_t last_recno; /* Column-store last record number */ |