0
0
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:
Eliot Horowitz 2009-12-18 11:24:10 -05:00
parent 65ee1eafde
commit 159f7df930
2 changed files with 4 additions and 2 deletions

View File

@ -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;
}

View File

@ -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 */