Actions
Bug #26567
closedn+1 when listing VMs on VMware
Difficulty:
Triaged:
No
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
Actions