host status migration is very slow
Fixed in Releases:
Found in Releases:
On a largish db, calculating the host status takes a whole lot of time.
it seems that many queries are repeating them selfs are simply could be eager loaded for the migration.
Updated by Ohad Levy about 8 years ago
- we do host.each, not sure if we can avoid it, but we could try to loop in batches and load associated data.
- the status calculation is done per host, which might not be avoidable, but I would like to see if we can wrap it in a host collection instead of a single host to avoid many n+1 queries.