0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-12-01 09:32:32 +01:00

SERVER-2977 use query optimizer cursor for distinct

This commit is contained in:
Aaron 2011-05-17 22:54:05 -07:00
parent 859bb3ad16
commit aa0865f655

View File

@ -63,7 +63,7 @@ namespace mongo {
shared_ptr<Cursor> cursor;
if ( ! query.isEmpty() ) {
cursor = bestGuessCursor(ns.c_str() , query , BSONObj() );
cursor = NamespaceDetailsTransient::getCursor(ns.c_str() , query , BSONObj() );
}
else {
@ -84,7 +84,7 @@ namespace mongo {
}
if ( ! cursor.get() )
cursor = bestGuessCursor(ns.c_str() , query , BSONObj() );
cursor = NamespaceDetailsTransient::getCursor(ns.c_str() , query , BSONObj() );
}
@ -98,7 +98,8 @@ namespace mongo {
nscanned++;
bool loadedObject = false;
if ( !cursor->matcher() || cursor->matcher()->matchesCurrent( cursor.get() , &md ) ) {
if ( ( !cursor->matcher() || cursor->matcher()->matchesCurrent( cursor.get() , &md ) ) &&
!cursor->getsetdup( cursor->currLoc() ) ) {
n++;
BSONElementSet temp;