The query implemented in this diff is fast on our dataset (P569).
But, that currently fails on db storage tests.
Because it relies on the `object_counts` table and it seems to notfail to update itselfn test context.
What would be a correctbetter way toto implement or test this?
Note:
Related to T2120