If an index has never been used (or not for a long time), is it really necessary to use hard drive storage for the index?
After a sufficiently long time has passed, it seems like it would be possible to purge storage of index data. The index would need to be rebuilt if the index becomes required for a query.
Alternatively, a different implementation approach could be taken. It seems possible for indices to start off disabled. Once an index is used (for a query), it would become enabled automatically and rebuilt from existing table data.
The benefit of this approach would be somewhat reduced storage footprint. Secondary benefits may includes slightly faster save operations, and (possibly) slightly reduced journal footprint.
This approach would effectively catch cases where indices exist in class definitions but are no longer relevant for queries. It would also catch cases where data is persisted, but queries are never run against the class at all.
Thank you for submitting the idea. The status has been changed to "Needs review".