bail out or clause checking if we do an unpredicted table scan

This commit is contained in:
Aaron
2010-07-20 13:58:58 -07:00
parent 4760c02457
commit decb87e5b7
3 changed files with 9 additions and 3 deletions

View File

@@ -641,7 +641,8 @@ namespace mongo {
_honorRecordedPlan( honorRecordedPlan ),
_bestGuessOnly( bestGuessOnly ),
_hint( ( hint && !hint->eoo() ) ? hint->wrap() : BSONObj() ),
_mayYield( mayYield )
_mayYield( mayYield ),
_tableScanned()
{
if ( !order.isEmpty() || !min.isEmpty() || !max.isEmpty() || !_fros.getSpecial().empty() ) {
_or = false;
@@ -670,6 +671,9 @@ namespace mongo {
BSONElement hintElt = _hint.firstElement();
_currentQps.reset( new QueryPlanSet( _ns, frs, _query, BSONObj(), &hintElt, _honorRecordedPlan, BSONObj(), BSONObj(), _bestGuessOnly, _mayYield ) );
shared_ptr< QueryOp > ret( _currentQps->runOp( op ) );
if ( ret->qp().willScanTable() ) {
_tableScanned = true;
}
_fros.popOrClause();
return ret;
}