summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorMathias Stearn <mathias@10gen.com>2010-07-07 21:07:54 -0400
committerMathias Stearn <mathias@10gen.com>2010-07-07 21:31:14 -0400
commit724228684e1bd1b9c476f662f4a259dbb7f1d5d0 (patch)
treef461d8ed5dbb42da1565f975947836e8ae8b668e /tools
parent1329d93774dfa5154a7ddfcee22c4821e1c84d01 (diff)
downloadmongo-724228684e1bd1b9c476f662f4a259dbb7f1d5d0.tar.gz
Add --indexesLast option since it's not always faster SERVER-1377
Diffstat (limited to 'tools')
-rw-r--r--tools/restore.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/restore.cpp b/tools/restore.cpp
index ebbf127b1f3..115297b72a4 100644
--- a/tools/restore.cpp
+++ b/tools/restore.cpp
@@ -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);