Bug #26567
n+1 when listing VMs on VMware
Pull request:
Fixed in Releases:
Found in Releases:
Description
When listing VMs on a Vmware Compute Resource, we hit the db with a n+1 query.
This is done for every host:
13:28:58 rails.1 | 2019-04-09T13:28:58 [D|sql|4b127620] Host::Managed Exists (0.7ms) SELECT 1 AS one FROM "hosts" WHERE "hosts"."type" IN ('Host::Managed') AND "hosts"."compute_resource_id" = $1 AND "hosts"."uuid" = $2 LIMIT $3 [["compute_resource_id", 5], ["uuid", "5004a5ec-bc04-1e1d-d91d-be832dcde7b9"], ["LIMIT", 1]]
13:28:58 rails.1 | 2019-04-09T13:28:58 [D|sql|4b127620] ↳ app/helpers/compute_resources_vms_helper.rb:239
Associated revisions
History
#1
Updated by The Foreman Bot almost 2 years ago
- Assignee set to Marek Hulán
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/6666 added
#2
Updated by The Foreman Bot over 1 year ago
- Pull request https://github.com/theforeman/foreman/pull/6740 added
#3
Updated by Tomer Brisker 11 months ago
- Status changed from Ready For Testing to New
#4
Updated by The Foreman Bot 11 months ago
- Status changed from New to Ready For Testing
#5
Updated by The Foreman Bot 11 months ago
- Fixed in Releases 2.1.0 added
#6
Updated by Marek Hulán 11 months ago
- Status changed from Ready For Testing to Closed
Applied in changeset 3188de3a156347a89a6a9dd6014d6424f9e0b4a7.
Fixes #26567 - improve vm listing performance