Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-7318

Implement index lastUsed timestamp

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Index Maintenance
    • 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 Unassigned
            Reporter:
            jwage Jonathan H. Wage
            Votes:
            2 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: