[SERVER-7318] Implement index lastUsed timestamp Created: 10/Oct/12  Updated: 18/May/15  Resolved: 18/May/15

Status: Closed
Project: Core Server
Component/s: Index Maintenance
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Jonathan H. Wage Assignee: Unassigned
Resolution: Duplicate Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-44432 Per index access stats Closed
Participants:

 Description   

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.


Generated at Thu Feb 08 03:14:11 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.