In addition to T50506: It is possible to run the entity_per_page recreation code on a per entity base on a LinksUpdate?
A LinksUpdate is usally trigged on edit/nulledit and with api action=purge&forcelinkupdate=
On normal wikis you can use this to update the links tables like categorylinks or templatelinks to the current state of the page. In my opinion this is also needed for wikibase items, than every one can trigger that and the wb_entity_per_page table will be up to date. No need for a maintenance script to be run, because nobody knows, if sometimes a entity is still missing.