diff options
author | Alex Gorrod <alexg@wiredtiger.com> | 2015-05-14 06:43:52 +0000 |
---|---|---|
committer | Alex Gorrod <alexg@wiredtiger.com> | 2015-05-14 06:43:52 +0000 |
commit | 0996902fa9837cb5284b12ffe3c64b44a59d5d28 (patch) | |
tree | bc76457e64aca3ae8acd126a4fb8cbf234ae35b5 | |
parent | c9a51c7ffebe17d492f8d3713503922d713e4e40 (diff) | |
download | mongo-0996902fa9837cb5284b12ffe3c64b44a59d5d28.tar.gz |
Don't create bloom filters on the oldest chunk unless configured.
The recent bulk load change meant that we sometimes created a bloom
filter on the oldest chunk when running compact.
Caused performance to drop by 50% in wtperf medium lsm compact job.
-rw-r--r-- | src/lsm/lsm_tree.c | 12 | ||||
-rw-r--r-- | src/lsm/lsm_work_unit.c | 4 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/lsm/lsm_tree.c b/src/lsm/lsm_tree.c index 97360089d48..640af3caf9d 100644 --- a/src/lsm/lsm_tree.c +++ b/src/lsm/lsm_tree.c @@ -1222,6 +1222,18 @@ __wt_lsm_compact(WT_SESSION_IMPL *session, const char *name, int *skip) WT_ERR_MSG(session, EINVAL, "LSM compaction requires active merge threads"); + /* + * We are done if there is a single chunk in the tree and we have + * already created a bloom filter for it or we are configured not to. + */ + if (lsm_tree->nchunks == 1 && + (FLD_ISSET(lsm_tree->bloom, WT_LSM_BLOOM_OLDEST) && + F_ISSET(lsm_tree->chunk[0], WT_LSM_CHUNK_BLOOM) || + !FLD_ISSET(lsm_tree->bloom, WT_LSM_BLOOM_OLDEST))) { + __wt_lsm_tree_release(session, lsm_tree); + return (0); + } + WT_ERR(__wt_seconds(session, &begin)); /* diff --git a/src/lsm/lsm_work_unit.c b/src/lsm/lsm_work_unit.c index 33174c2d40d..7a2c0ebb190 100644 --- a/src/lsm/lsm_work_unit.c +++ b/src/lsm/lsm_work_unit.c @@ -215,6 +215,10 @@ __wt_lsm_work_bloom(WT_SESSION_IMPL *session, WT_LSM_TREE *lsm_tree) chunk->count == 0) continue; + /* Never create a bloom filter on the oldest chunk */ + if (chunk == lsm_tree->chunk[0] && + !FLD_ISSET(lsm_tree->bloom, WT_LSM_BLOOM_OLDEST)) + continue; /* * See if we win the race to switch on the "busy" flag and * recheck that the chunk still needs a Bloom filter. |