mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 01:21:03 +01:00
Add --indexesLast option since it's not always faster SERVER-1377
This commit is contained in:
parent
1329d93774
commit
724228684e
@ -33,11 +33,13 @@ class Restore : public BSONTool {
|
||||
public:
|
||||
|
||||
bool _drop;
|
||||
bool _indexesLast;
|
||||
const char * _curns;
|
||||
|
||||
Restore() : BSONTool( "restore" ) , _drop(false){
|
||||
add_options()
|
||||
("drop" , "drop each collection before import" )
|
||||
("indexesLast" , "wait to add indexes (faster if data isn't inserted in index order)" )
|
||||
;
|
||||
add_hidden_options()
|
||||
("dir", po::value<string>()->default_value("dump"), "directory to restore from")
|
||||
@ -53,6 +55,7 @@ public:
|
||||
auth();
|
||||
path root = getParam("dir");
|
||||
_drop = hasParam( "drop" );
|
||||
_indexesLast = hasParam("indexesLast");
|
||||
|
||||
/* If _db is not "" then the user specified a db name to restore as.
|
||||
*
|
||||
@ -97,7 +100,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
if ( p.leaf() == "system.indexes.bson" )
|
||||
if ( _indexesLast && p.leaf() == "system.indexes.bson" )
|
||||
indexes = p;
|
||||
else
|
||||
drillDown(p, use_db, use_coll);
|
||||
|
Loading…
Reference in New Issue
Block a user