mirror of
https://github.com/mongodb/mongo.git
synced 2024-11-30 00:56:44 +01:00
reset query optimizer stats on adding or removing an index
This commit is contained in:
parent
65ee1eafde
commit
159f7df930
@ -446,9 +446,9 @@ namespace mongo {
|
||||
} dbc_unittest;
|
||||
|
||||
bool deleteIndexes( NamespaceDetails *d, const char *ns, const char *name, string &errmsg, BSONObjBuilder &anObjBuilder, bool mayDeleteIdIndex ) {
|
||||
|
||||
|
||||
d->aboutToDeleteAnIndex();
|
||||
|
||||
|
||||
/* there may be pointers pointing at keys in the btree(s). kill them. */
|
||||
ClientCursor::invalidate(ns);
|
||||
|
||||
@ -502,6 +502,7 @@ namespace mongo {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
NamespaceDetailsTransient::get_w( ns ).clearQueryCache();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1203,6 +1203,7 @@ namespace mongo {
|
||||
n = addExistingToIndex(ns.c_str(), d, idx, idxNo);
|
||||
}
|
||||
log() << "done for " << n << " records " << t.millis() / 1000.0 << "secs" << endl;
|
||||
NamespaceDetailsTransient::get_w( ns.c_str() ).clearQueryCache();
|
||||
}
|
||||
|
||||
/* add keys to indexes for a new record */
|
||||
|
Loading…
Reference in New Issue
Block a user