When clicking to show the "Artifact Count / Size" item for a repo item and also for the admin Storage page the web ui asks only one query to the database which might sound like a good idea until you have an installation of Artifactory with >50M artifacts.
The query will always wait for the SUM to complete even if the COUNT was a O(1) lookup in a cache.
I would suggest to make the COUNT query together with the inital page request since it should be constant with a correctly indexed table.
Let SUM queries be user initiated for both repo sub-items and the storage summary page. Or for that matter, keep a separate field in the DB for repo sizes.
The query for the storage page and takes a long time to return for large repositories.
And sometimes the index isn't properly used as shown below for a count/sum query of an empty repo.
After this query returned, the next lookup was immediate and hit the index. But sometimes it will execute a sequential read.