Example #1
0
 IndexSuitability IndexSpec::_suitability( const FieldRangeSet& queryConstraints ,
                                           const BSONObj& order ) const {
     // TODO: optimize
     if ( ! anyElementNamesMatch( keyPattern , queryConstraints.simplifiedQuery(keyPattern) )  &&
          ! anyElementNamesMatch( keyPattern , order ) )
         return USELESS;
     return HELPFUL;
 }
Example #2
0
 IndexSuitability ixmIndexKeyGen::_suitability( const BSONObj& query ,
                                                const BSONObj& order ) const
 {
     if ( anyElementNamesMatch( _keyPattern , query ) == 0 &&
          anyElementNamesMatch( _keyPattern , order ) == 0 )
        return USELESS;
     return HELPFUL;
 }
Example #3
0
 IndexSuitability IndexSpec::_suitability( const BSONObj& query , const BSONObj& order ) const {
     // TODO: optimize
     if ( anyElementNamesMatch( keyPattern , query ) == 0 && anyElementNamesMatch( keyPattern , order ) == 0 )
         return USELESS;
     return HELPFUL;
 }