diff options
author | Robert Guo <robert.guo@10gen.com> | 2016-04-12 17:47:30 -0400 |
---|---|---|
committer | Robert Guo <robert.guo@10gen.com> | 2016-04-29 16:07:43 -0400 |
commit | 1d58e42a8a2030d956c972dab20da9c9f01d61bf (patch) | |
tree | 05ab35edcb4dd5f30791261fa9ccee23132418a2 /src/mongo/db/commands/validate.cpp | |
parent | 98dacf304edac746ffd4f1820c0065fbf9aec7e3 (diff) | |
download | mongo-1d58e42a8a2030d956c972dab20da9c9f01d61bf.tar.gz |
SERVER-23055 optimize perf of hashtable used by validate()
Diffstat (limited to 'src/mongo/db/commands/validate.cpp')
-rw-r--r-- | src/mongo/db/commands/validate.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mongo/db/commands/validate.cpp b/src/mongo/db/commands/validate.cpp index 0037eba6d58..0357a0f7bd3 100644 --- a/src/mongo/db/commands/validate.cpp +++ b/src/mongo/db/commands/validate.cpp @@ -37,6 +37,7 @@ #include "mongo/db/commands.h" #include "mongo/db/db_raii.h" #include "mongo/db/query/internal_plans.h" +#include "mongo/db/storage/record_store.h" #include "mongo/util/fail_point_service.h" #include "mongo/util/log.h" @@ -90,7 +91,15 @@ public: NamespaceString ns_string(ns); const bool full = cmdObj["full"].trueValue(); - const bool scanData = full || cmdObj["scandata"].trueValue(); + const bool scanData = cmdObj["scandata"].trueValue(); + + ValidateCmdLevel level = kValidateIndex; + + if (full) { + level = kValidateFull; + } else if (scanData) { + level = kValidateRecordStore; + } if (!ns_string.isNormal() && full) { errmsg = "Can only run full validate on a regular collection"; @@ -112,7 +121,7 @@ public: result.append("ns", ns); ValidateResults results; - Status status = collection->validate(txn, full, scanData, &results, &result); + Status status = collection->validate(txn, level, &results, &result); if (!status.isOK()) return appendCommandStatus(result, status); |