diff options
author | Mathias Stearn <mathias@10gen.com> | 2010-07-07 21:07:54 -0400 |
---|---|---|
committer | Mathias Stearn <mathias@10gen.com> | 2010-07-07 21:31:14 -0400 |
commit | 724228684e1bd1b9c476f662f4a259dbb7f1d5d0 (patch) | |
tree | f461d8ed5dbb42da1565f975947836e8ae8b668e /tools | |
parent | 1329d93774dfa5154a7ddfcee22c4821e1c84d01 (diff) | |
download | mongo-724228684e1bd1b9c476f662f4a259dbb7f1d5d0.tar.gz |
Add --indexesLast option since it's not always faster SERVER-1377
Diffstat (limited to 'tools')
-rw-r--r-- | tools/restore.cpp | 5 |
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); |