Katello 4.9 is very slow

Also, this query

Still needs to be optimized. We’ve made a proposal here:

Like I said before, I have no idea which file I need to update, but it someone points me in the right direction I am willing to change this on our server to make sure it works.

We still have problem after update to 4.9.1