summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec
diff options
context:
space:
mode:
authorBenjamin Murphy <benjamin_murphy@me.com>2016-01-26 13:32:46 -0500
committerBenjamin Murphy <benjamin_murphy@me.com>2016-02-04 10:20:28 -0500
commit597164f5b23af7d391226cf96b635c9c19da2a1a (patch)
tree91f835fb0db2c0b4805599525d8e2a2dfaefffae /src/mongo/db/exec
parent5d6b9725a3da28fd1114cf1c45f41f3837578b51 (diff)
downloadmongo-597164f5b23af7d391226cf96b635c9c19da2a1a.tar.gz
SERVER-4494 Explain includes index version for 2dsphere and text stages.
Diffstat (limited to 'src/mongo/db/exec')
-rw-r--r--src/mongo/db/exec/geo_near.cpp2
-rw-r--r--src/mongo/db/exec/plan_stats.h11
-rw-r--r--src/mongo/db/exec/text.cpp1
3 files changed, 10 insertions, 4 deletions
diff --git a/src/mongo/db/exec/geo_near.cpp b/src/mongo/db/exec/geo_near.cpp
index c4ae337ab16..bfad1618b62 100644
--- a/src/mongo/db/exec/geo_near.cpp
+++ b/src/mongo/db/exec/geo_near.cpp
@@ -444,6 +444,7 @@ GeoNear2DStage::GeoNear2DStage(const GeoNearParams& nearParams,
_boundsIncrement(0.0) {
_specificStats.keyPattern = twoDIndex->keyPattern();
_specificStats.indexName = twoDIndex->indexName();
+ _specificStats.indexVersion = twoDIndex->version();
}
@@ -741,6 +742,7 @@ GeoNear2DSphereStage::GeoNear2DSphereStage(const GeoNearParams& nearParams,
_boundsIncrement(0.0) {
_specificStats.keyPattern = s2Index->keyPattern();
_specificStats.indexName = s2Index->indexName();
+ _specificStats.indexVersion = s2Index->version();
ExpressionParams::parse2dsphereParams(s2Index->infoObj(), &_indexParams);
}
diff --git a/src/mongo/db/exec/plan_stats.h b/src/mongo/db/exec/plan_stats.h
index d65446338f2..01af3cd0198 100644
--- a/src/mongo/db/exec/plan_stats.h
+++ b/src/mongo/db/exec/plan_stats.h
@@ -551,9 +551,8 @@ struct IntervalStats {
bool inclusiveMaxDistanceAllowed = false;
};
-class NearStats : public SpecificStats {
-public:
- NearStats() {}
+struct NearStats : public SpecificStats {
+ NearStats() : indexVersion(0) {}
SpecificStats* clone() const final {
return new NearStats(*this);
@@ -561,6 +560,8 @@ public:
std::vector<IntervalStats> intervalStats;
std::string indexName;
+ // btree index version, not geo index version
+ int indexVersion;
BSONObj keyPattern;
};
@@ -610,7 +611,7 @@ struct UpdateStats : public SpecificStats {
};
struct TextStats : public SpecificStats {
- TextStats() : parsedTextQuery() {}
+ TextStats() : parsedTextQuery(), textIndexVersion(0) {}
SpecificStats* clone() const final {
TextStats* specific = new TextStats(*this);
@@ -622,6 +623,8 @@ struct TextStats : public SpecificStats {
// Human-readable form of the FTSQuery associated with the text stage.
BSONObj parsedTextQuery;
+ int textIndexVersion;
+
// Index keys that precede the "text" index key.
BSONObj indexPrefix;
};
diff --git a/src/mongo/db/exec/text.cpp b/src/mongo/db/exec/text.cpp
index 295baa10b14..fdc53a11a25 100644
--- a/src/mongo/db/exec/text.cpp
+++ b/src/mongo/db/exec/text.cpp
@@ -64,6 +64,7 @@ TextStage::TextStage(OperationContext* txn,
_specificStats.indexPrefix = _params.indexPrefix;
_specificStats.indexName = _params.index->indexName();
_specificStats.parsedTextQuery = _params.query.toBSON();
+ _specificStats.textIndexVersion = _params.index->infoObj()["textIndexVersion"].numberInt();
}
bool TextStage::isEOF() {