Keep an up to date count of the number of objects in each archive
We need to keep a running count of the number of objects in each of our archives, and to publish that.
Scanning the 3 billion rows of the archiver table is not a reasonable option, as it takes multiple hours: we need to do something smarter.
One proposal is to keep a running count for all the objects, bucketed by the last bytes of the id, updated via a trigger on the content_archive table.
We can then run a full count by just using a sum on the few hundred thousand entries of that table.
Migrated from T672 (view on Phabricator)