Change eager_load to includes statement in hosts api controller's index action
|Assigned To:||Shimon Shtein|
|Target version:||Team Ivan Iteration 12|
|Found in release:||Pull request:||https://github.com/theforeman/foreman/pull/4365|
|Velocity based estimate||-|
Since the query is pretty wide (contains multiple joins) the execution plan will try to make all joins and only then try to filter unnecessary rows. This causes PG to load a huge temporary table into memory, and since it's too big to fit in, the CPU sky rockets.