Wikidata/editgroups

Precompute number of entities edited during ingestion

wetneb opened this issue · 1 comments

Currently we run this query for every batch page:

COUNT(*) FROM (SELECT DISTINCT `store_edit`.`title` AS Col1 FROM `store_edit` WHERE `store_edit`.`batch_id` = 37122)

This is very expensive for large edit groups.
We should instead maintain a count of entities edited, just like we cache the edit count. It is slightly more expensive to maintain as we need to match the ingested edits to the existing ones but we already have an index for that anyway.

We might need to do this for reverts and item creations too. Groups like https://tools.wmflabs.org/editgroups/b/QSv2T/1541227030033/ still take a while to load.