As discussed in T124737.
- Stop using eu_touched in SELECTs
- Stop updating (touching) it
- Drop it.
After a user edited a page we immediately run DataUpdateHookHandlers::doParserCacheSaveComplete, thus adding the new usage entries to the table (without removing any of the old values). Some time after that a LinksUpdate job will run (asynchronously), that will trigger DataUpdateHookHandlers::doLinksUpdateComplete which deletes all usage entries, except for those in the ParserOutput of the edit that triggered the LinksUpdate.
Pruning all old entries during a LinksUpdate run is ok as we also invalidate all older parser cache entries in that case.
Please note that page views that happen between the page save but before the LinksUpdate run will have their usages being lost (as we initially insert the usages via DataUpdateHookHandlers::doParserCacheSaveComplete, but delete them in our LinksUpdate hook handler later on). That is a problem with the current implementation and will also be one in the new implementation without eu_touched.
On page view:
Page views in languages we don't have in the parser cache trigger DataUpdateHookHandlers::doParserCacheSaveComplete which inserts the additional usages into the table (but doesn't prune any).