Description of problem:
The query as defined for GetAllFromVms in vms_sp.sql is inefficient, when a moderate number of VMs exist.
Version-Release number of selected component (if applicable):
ovirt 3.5
How reproducible:
100%
Steps to Reproduce:
explain select already signifies that the query is not very optimized
with real life VDI data, its cost becomes significant (say, 1000 users, 1000 vms, ...)
Actual results:
EXPLAIN shows a high cost, and lists 148 actions (for the isolated query)
This results in high load on the database, when many users are logged into the user portal.
Expected results:
This should query should be more optimized, as it is called very frequently (user portal refresh)
Additional info:
Hi
It's impossible to tune this query, as it's running against the VM view, which we can't change...
I'll try to see if we can decrease the number of calls to it.