Implement index lastUsed timestamp

XMLWordPrintableJSON

    • Type: Improvement
    • Resolution: Duplicate
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Index Maintenance
    • None
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

              Assignee:
              Unassigned
              Reporter:
              Jonathan H. Wage
              Votes:
              2 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: