summaryrefslogtreecommitdiff
path: root/src/btree/rec_split.c
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2014-04-03 21:42:33 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2014-04-03 21:42:33 +1100
commit3c6b862ff46d29016df9d30f16b28f7cae64f929 (patch)
tree95e595bb33a94151d3a35c98219b770347c45d8f /src/btree/rec_split.c
parent31a1675963d4ff99d5445461cd10051367fe034d (diff)
downloadmongo-3c6b862ff46d29016df9d30f16b28f7cae64f929.tar.gz
Flip the logic around when to deepen the tree -- there is no point trying to deepen if there aren't enough children for the split.
Deepen sooner: when leaves grow and split in two repeatedly, it takes a lot of re-allocation for the parent to reach 200K children.
Diffstat (limited to 'src/btree/rec_split.c')
-rw-r--r--src/btree/rec_split.c24
1 files changed, 10 insertions, 14 deletions
diff --git a/src/btree/rec_split.c b/src/btree/rec_split.c
index 27ae2f9a512..5bb4e231aa5 100644
--- a/src/btree/rec_split.c
+++ b/src/btree/rec_split.c
@@ -12,8 +12,8 @@
* any real understanding of what might be useful to surface to applications.
*/
static u_int __split_deepen_max_internal_image = 100;
-static u_int __split_deepen_min_child = 200;
-static u_int __split_deepen_per_child = 1000;
+static u_int __split_deepen_min_child = 100;
+static u_int __split_deepen_per_child = 100;
/*
* __split_should_deepen --
@@ -30,30 +30,26 @@ __split_should_deepen(WT_SESSION_IMPL *session, WT_PAGE *page)
* to search), or by the memory footprint of the parent page (avoiding
* an internal page that will eat up all of the cache and put eviction
* pressure on the system).
- *
- * Paranoia: don't try and split if we don't have anything to split.
*/
pindex = WT_INTL_INDEX_COPY(page);
- if (pindex->entries < 50)
- return (0);
/*
- * Split to deepen the tree if the page's memory footprint is N times
- * the maximum internal page size chunk in the backing file.
+ * Don't deepen the tree if the page's memory footprint is less than N
+ * times the maximum internal page size chunk in the backing file.
*/
- if (page->memory_footprint >
+ if (page->memory_footprint <
__split_deepen_max_internal_image * S2BT(session)->maxintlpage)
- return (1);
+ return (0);
/*
- * Split to deepen the tree if the split will result in at least N
+ * Don't deepen the tree unless the split will result in at least N
* children in the newly created intermediate layer.
*/
- if (pindex->entries >
+ if (pindex->entries <
(__split_deepen_per_child * __split_deepen_min_child))
- return (1);
+ return (0);
- return (0);
+ return (1);
}
/*