summaryrefslogtreecommitdiff
path: root/src/mongo/db/query/index_bounds.cpp
diff options
context:
space:
mode:
authorHari Khalsa <hkhalsa@10gen.com>2013-10-29 21:41:09 -0400
committerHari Khalsa <hkhalsa@10gen.com>2013-10-30 16:07:48 -0400
commit67defc7ee10099e727a6091bbd0ff154e2908b00 (patch)
tree43abaedf20ddf0c58e0bf02eebdb92e3622477e8 /src/mongo/db/query/index_bounds.cpp
parenta154946a48b3fea77747f810ff60dce734e9b0dd (diff)
downloadmongo-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.cpp15
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,