Hello @nofaralfasi ,
a large number of hostgroups might not be the perfect situation, but until 3.12 it was “fast”.
So I think there is a regression (bug), which should be fixed. As you mentioned Foreman 1.24.2 - very slow hostgroup view and edit for non admin user - #2 by tbrisker - there was also a “bug” in caching taxonomie queries.