diff options
author | Eliot Horowitz <eliot@10gen.com> | 2013-10-30 16:36:01 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2013-11-02 13:19:54 -0400 |
commit | f4752b153a3294bd6dfbfb3b626526c7baf7f90e (patch) | |
tree | 298f68154117a8c6b32b6af2f306c15a93bd1800 /src/mongo/db/commands/dbhash.cpp | |
parent | c83e2593e8ad68bd2ad09eaaa4e28df34d0da068 (diff) | |
download | mongo-f4752b153a3294bd6dfbfb3b626526c7baf7f90e.tar.gz |
SERVER-11178: IndexScan now uses IndexCatalog classes
Diffstat (limited to 'src/mongo/db/commands/dbhash.cpp')
-rw-r--r-- | src/mongo/db/commands/dbhash.cpp | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/src/mongo/db/commands/dbhash.cpp b/src/mongo/db/commands/dbhash.cpp index 7bb796e8af9..ab986fc2780 100644 --- a/src/mongo/db/commands/dbhash.cpp +++ b/src/mongo/db/commands/dbhash.cpp @@ -80,34 +80,22 @@ namespace mongo { } *fromCache = false; - NamespaceDetails * nsd = nsdetails( fullCollectionName ); - verify( nsd ); - - // debug SERVER-761 - NamespaceDetails::IndexIterator ii = nsd->ii(); - while( ii.more() ) { - const IndexDetails &idx = ii.next(); - if ( !idx.head.isValid() || !idx.info.isValid() ) { - log() << "invalid index for ns: " << fullCollectionName << " " << idx.head << " " << idx.info; - if ( idx.info.isValid() ) - log() << " " << idx.info.obj(); - log() << endl; - } - } + Collection* collection = cc().database()->getCollection( fullCollectionName ); + if ( !collection ) + return ""; + + IndexDescriptor* desc = collection->getIndexCatalog()->findIdIndex(); auto_ptr<Runner> runner; - int idNum = nsd->findIdIndex(); - if ( idNum >= 0 ) { - runner.reset(InternalPlanner::indexScan(fullCollectionName, - nsd, - idNum, + if ( desc ) { + runner.reset(InternalPlanner::indexScan(desc, BSONObj(), BSONObj(), false, InternalPlanner::FORWARD, InternalPlanner::IXSCAN_FETCH)); } - else if ( nsd->isCapped() ) { + else if ( collection->details()->isCapped() ) { runner.reset(InternalPlanner::collectionScan(fullCollectionName)); } else { |