|
It would be super useful to have a lastUsed timestamp on indexes. So when I do the following:
> db.users.getIndexes()
|
[
|
{
|
"v" : 1,
|
"key" : {
|
"_id" : 1
|
},
|
"ns" : "dbname.users",
|
"name" : "_id_",
|
"lastUsed" : ISODate("2012-09-17T16:14:29Z")
|
},
|
{
|
"v" : 1,
|
"key" : {
|
"username" : 1
|
},
|
"unique" : true,
|
"ns" : "dbname.users",
|
"background" : true,
|
"name" : "username_1",
|
"lastUsed" : ISODate("2012-09-20T16:14:29Z")
|
}
|
]
|
This would allow me to then write a script to determine which indexes have not been used since date and drop them if they are no longer used.
|