diff options
author | Hari Khalsa <hkhalsa@10gen.com> | 2013-10-29 21:41:09 -0400 |
---|---|---|
committer | Hari Khalsa <hkhalsa@10gen.com> | 2013-10-30 16:07:48 -0400 |
commit | 67defc7ee10099e727a6091bbd0ff154e2908b00 (patch) | |
tree | 43abaedf20ddf0c58e0bf02eebdb92e3622477e8 /src/mongo/db/query/index_bounds.cpp | |
parent | a154946a48b3fea77747f810ff60dce734e9b0dd (diff) | |
download | mongo-67defc7ee10099e727a6091bbd0ff154e2908b00.tar.gz |
SERVER-10026 sort with improved sort analysis
Diffstat (limited to 'src/mongo/db/query/index_bounds.cpp')
-rw-r--r-- | src/mongo/db/query/index_bounds.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/mongo/db/query/index_bounds.cpp b/src/mongo/db/query/index_bounds.cpp index 5d4228e793f..f9190976a9f 100644 --- a/src/mongo/db/query/index_bounds.cpp +++ b/src/mongo/db/query/index_bounds.cpp @@ -288,6 +288,21 @@ namespace mongo { return false; } + bool IndexBoundsChecker::isValidKey(const BSONObj& key) { + BSONObjIterator it(key); + size_t curOil = 0; + while (it.more()) { + BSONElement elt = it.next(); + size_t whichInterval; + Location loc = findIntervalForField(elt, _bounds->fields[curOil], _expectedDirection[curOil], &whichInterval); + if (WITHIN != loc) { + return false; + } + ++curOil; + } + return true; + } + IndexBoundsChecker::KeyState IndexBoundsChecker::checkKey(const BSONObj& key, int* keyEltsToUse, bool* movePastKeyElts, |