Foreman 1.24.2 - very slow hostgroup view and edit for non admin user

Thank you for bringing this up!
The reason there are many more sql queries for non-admin user is that we need to do check for authorization for all resources for the user - on the index page, for calculating the host counts, and on the edit page, for all of the different attributes on the form.
Looking at the logs, the SQL queries may be very many, but nearly all of them conclude in <1ms, meaning that the issue is not in inefficient queries but rather in the shear number of them - 11k queries would mean around 10 seconds for the page to load - is this consistent with what you are seeing?
We did have some improvements in the authorization speed that will land in 2.0 but i can’t tell for sure if it will fix this issue for you.
You can also try adding config.active_record.verbose_query_logs = Foreman::Logging.logger('sql') to /usr/share/foreman/config/production.rb which should also add source lines for each sql query so we can see where it is triggered from.

To make sure this thread doesn’t get lost in the history, can you please also open a bug report on our bug tracker?