Skip to content

Commit

Permalink
Remove _special attribute from QueryPlanSet.
Browse files Browse the repository at this point in the history
  • Loading branch information
astaple committed Apr 25, 2012
1 parent e72155e commit fd4ed51
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
14 changes: 7 additions & 7 deletions src/mongo/db/queryoptimizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,18 +499,18 @@ namespace mongo {

DEBUGQO( "\t special : " << _frsp->getSpecial() );
if ( _frsp->getSpecial().size() ) {
_special = _frsp->getSpecial();
string special = _frsp->getSpecial();
NamespaceDetails::IndexIterator i = d->ii();
while( i.more() ) {
int j = i.pos();
IndexDetails& ii = i.next();
const IndexSpec& spec = ii.getSpec();
if ( spec.getTypeName() == _special && spec.suitability( _originalQuery , _order ) ) {
addPlan( newQueryPlan( d, j, BSONObj(), BSONObj(), _special ) );
if ( spec.getTypeName() == special && spec.suitability( _originalQuery , _order ) ) {
addPlan( newQueryPlan( d, j, BSONObj(), BSONObj(), special ) );
return;
}
}
uassert( 13038 , (string)"can't find special index: " + _special + " for: " + _originalQuery.toString() , 0 );
uassert( 13038 , (string)"can't find special index: " + special + " for: " + _originalQuery.toString() , 0 );
}

// If table scan is optimal or natural order requested.
Expand Down Expand Up @@ -579,7 +579,7 @@ namespace mongo {
const BSONObj &min, const BSONObj &max,
const string &special ) {
QueryPlanPtr ret( new QueryPlan( d, idxNo, *_frsp, _originalFrsp.get(), _originalQuery,
_order, _parsedQuery, min, max, _special ) );
_order, _parsedQuery, min, max, special ) );
return ret;
}

Expand Down Expand Up @@ -871,8 +871,8 @@ namespace mongo {
return holder._op;
}
if ( _plans.hasPossiblyExcludedPlans() &&
op.nscanned() > _plans._oldNScanned * 10 &&
_plans._special.empty() ) {
op.nscanned() > _plans._oldNScanned * 10 ) {
verify( _plans.nPlans() == 1 && _plans.firstPlan()->special().empty() );
holder._offset = -op.nscanned();
_plans.addFallbackPlans();
PlanSet::iterator i = _plans._plans.begin();
Expand Down
1 change: 0 additions & 1 deletion src/mongo/db/queryoptimizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,6 @@ namespace mongo {
RecordedPlanPolicy _recordedPlanPolicy;
BSONObj _min;
BSONObj _max;
string _special;
ElapsedTracker _yieldSometimesTracker;
};

Expand Down

0 comments on commit fd4ed51

Please sign in to comment.