Actions
Bug #10589
closedN+1 Query when changing hostgroup from the "All Hosts" page
Difficulty:
Triaged:
Bugzilla link:
Pull request:
Description
I believe there is a N+1 query when modifying a single host or multiple hosts from the "All Hosts" page of the Foreman. Changing a hostgroup from this page is taking ~5-8 minutes to complete depending on the number of hosts being modified.
Found by loading foreman-rake console
hg = Hostgroup.find_by_id(1)
h = Host.find_by_name("name of host")
h.hostgroup=hg
h.save(:validate => false)
I've attached the specific query that I believe has the N+1. It is executed several times in this block of code which I think is the reason the host group change takes such a long time to complete.
Files
Updated by Tom Caspy over 9 years ago
- Related to Tracker #11657: Performance refactoring for HostsController added
Updated by The Foreman Bot over 9 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/2684 added
- Pull request deleted (
)
Updated by Dominic Cleal over 9 years ago
- Translation missing: en.field_release set to 72
Updated by Tom Caspy over 9 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 88275be4587e98092095c501a8a7f58d7bcfaca4.
Updated by Dominic Cleal over 9 years ago
- Translation missing: en.field_release changed from 72 to 88
Actions