When going through subfolders, Artifactory uses the following statement:
SELECT COUNT(1) FROM nodes WHERE repo = 'repo' AND node_path like 'com/xxxxx/<group>/<project> /<subfolder>' AND depth = 6;'.
This can be slow, replacing 'like' with '=' is much faster. However, with an '=' wildcards cannot be used. Optimize the query so that is wildcards are used, 'like' will be used, but without wildcards, '=' is used in the SQL statement.