Can you please open a PR against Foreman itself instead of against your own fork?
Of course. It was created only as a POC for me to easily test it.
Now itâs Fixes #39323 - Optimize grouped authorization filter handling by pablomh ¡ Pull Request #10988 ¡ theforeman/foreman ¡ GitHub upstream.
Hi @singularity001. I dug into this further and put together a proposed fix here: pablomh/foreman#10
You are awesome. These look like some crazy huge improvements, which for someone with as large of a Foreman environment as us, is really important.
I should be able to test these changes out today.
I would say as of right now the results (on the /hosts) page are inconclusive. Pre patch load time for a user with all locations and orgs was 9-15 seconds (to load 25 hosts per page). After the patch it is still the same amount of time. It could just be that because this user has so many locations and orgs - thats just how long it takes..
I wouldnât dismiss your original findings and what you had in the initializer patch. I borrowed some ideas from it and opened Fixes #39336 - Batch taxonomy subtree lookups to avoid N+1 queries by adamruzicka ¡ Pull Request #10990 ¡ theforeman/foreman ¡ GitHub to address the âa user with all the org/locsâ use case, which is slightly different than what Pabloâs fix was aiming at.