Checking which indexes are used

121 views
Skip to first unread message

Simon Hutton

unread,
Jan 11, 2022, 10:26:15 AM1/11/22
to Google App Engine
Is there a way to see which DataStore indexes are still used?  Something like a 'last accessed date' for an index would be ideal.

I'm running quite an old project on GAE (Python 2.7) and suspect many on the indexes are no longer needed.

Thanks
Simon

rwabukumba

unread,
Jan 11, 2022, 5:31:56 PM1/11/22
to Google App Engine
Hi, 

We do display datastore statistics that you can use to verify index size, status, etc, but not anyway to show when a given index was last used.

I looked through the datastore statistics package but didn't readily see anything that we could use to derive usage-frequency of any given index. However, if there is a possibility of obtaining such details, perhaps the information in this article [1] may prove useful in guiding you through the process. I also found an open request for this feature request [2]. I recommend starring it as the more +1s it gets, the more visibility the request gets,  and the more chances that the datastore team considers it.

In the meantime, if you are not able to obtain the info you are looking for using the guide in [1], then opening a support case will be a more suitable next step since the support team may be able to use internal tools to provide this information to you. 

Nickolas Daskalou

unread,
Jan 11, 2022, 7:23:42 PM1/11/22
to google-a...@googlegroups.com
You could look into the db package and try use an existing hook called before/after a query is made, then log details of the entity kinds being queried (if it's possible to extract that info).

Using an expiring Memcache flag for that particular query/entity combination would ensure you're not littering your logs with these messages.

Then let your app run for a week/month and see what turns up in the logs.

Not an out of the box solution, but might give you what you need.

Nick


--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/211ddfb9-703f-4f09-8ac2-d4a169217d7cn%40googlegroups.com.

NoCommandLine

unread,
Jan 12, 2022, 1:05:53 AM1/12/22
to Google App Engine
Another possible work around is to test your App locally (on your dev server) starting with a blank index.yaml file. When you are done testing, you will now have an updated index file. You can then run the datastore indexes clean up command which will compare your production version with the local version and remove any index in production which is not in the local version

 ..... NoCommandLine ......
 https://nocommandline.com

A GUI for Google App Engine
Reply all
Reply to author
Forward
0 new messages