summaryrefslogtreecommitdiff
path: root/db/queryutil.h
diff options
context:
space:
mode:
authorAaron <aaron@10gen.com>2010-06-01 16:21:21 -0700
committerAaron <aaron@10gen.com>2010-06-01 16:21:21 -0700
commite327eff2618d2caa9afda5c3eacb440cef23e4cd (patch)
treef6eed2182d33cb7254b32cdecac69ec46d2a3d26 /db/queryutil.h
parenteb9e26c66e7676f6e7b73eeb01b1b3c2bb7bb6d6 (diff)
downloadmongo-e327eff2618d2caa9afda5c3eacb440cef23e4cd.tar.gz
SERVER-109 reinstate FieldRangeOrSet, make FieldRangeSet a parameter to QueryPlanSet
Diffstat (limited to 'db/queryutil.h')
-rw-r--r--db/queryutil.h68
1 files changed, 34 insertions, 34 deletions
diff --git a/db/queryutil.h b/db/queryutil.h
index f872b69465a..87f8b0750b5 100644
--- a/db/queryutil.h
+++ b/db/queryutil.h
@@ -208,40 +208,40 @@ namespace mongo {
};
// generages FieldRangeSet objects, accounting for or clauses
-// class FieldRangeOrSet {
-// public:
-// FieldRangeOrSet( const char *ns, const BSONObj &query , bool optimize=true );
-// // if there's a trivial or clause, we won't use or ranges to help with scanning
-// bool trivialOr() const {
-// for( list< FieldRangeSet >::const_iterator i = _orSets.begin(); i != _orSets.end(); ++i ) {
-// if ( i->nNontrivialRanges() == 0 ) {
-// return true;
-// }
-// }
-// return false;
-// }
-// bool orFinished() const { return _orFound && _orSets.empty(); }
-// // removes first or clause, and removes the field ranges it covers from all subsequent or clauses
-// void popOrClause() {
-// massert( 13274, "no or clause to pop", !orFinished() );
-// const FieldRangeSet &toPop = _orSets.front();
-// list< FieldRangeSet >::iterator i = _orSets.begin();
-// ++i;
-// while( i != _orSets.end() ) {
-// *i -= toPop;
-// if( !i->matchPossible() ) {
-// i = _orSets.erase( i );
-// } else {
-// ++i;
-// }
-// }
-// _orSets.pop_front();
-// }
-// private:
-// FieldRangeSet _baseSet;
-// list< FieldRangeSet > _orSets;
-// bool _orFound;
-// };
+ class FieldRangeOrSet {
+ public:
+ FieldRangeOrSet( const char *ns, const BSONObj &query , bool optimize=true );
+ // if there's a trivial or clause, we won't use or ranges to help with scanning
+ bool trivialOr() const {
+ for( list< FieldRangeSet >::const_iterator i = _orSets.begin(); i != _orSets.end(); ++i ) {
+ if ( i->nNontrivialRanges() == 0 ) {
+ return true;
+ }
+ }
+ return false;
+ }
+ bool orFinished() const { return _orFound && _orSets.empty(); }
+ // removes first or clause, and removes the field ranges it covers from all subsequent or clauses
+ void popOrClause() {
+ massert( 13274, "no or clause to pop", !orFinished() );
+ const FieldRangeSet &toPop = _orSets.front();
+ list< FieldRangeSet >::iterator i = _orSets.begin();
+ ++i;
+ while( i != _orSets.end() ) {
+ *i -= toPop;
+ if( !i->matchPossible() ) {
+ i = _orSets.erase( i );
+ } else {
+ ++i;
+ }
+ }
+ _orSets.pop_front();
+ }
+ private:
+ FieldRangeSet _baseSet;
+ list< FieldRangeSet > _orSets;
+ bool _orFound;
+ };
/**
used for doing field limiting