Bug 1151477

Summary: GetAllFromVms stored function is inefficient
Product: [Retired] oVirt Reporter: Tim Speetjens <tspeetje>
Component: ovirt-engine-userportalAssignee: Tim Speetjens <tspeetje>
Status: CLOSED CURRENTRELEASE QA Contact: Pavel Stehlik <pstehlik>
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: ecohen, gklein, iheim, lsurette, lzelkha, oourfali, pablo.iranzo, rbalakri, tdosek, yeylon
Target Milestone: ---Keywords: Performance
Target Release: 3.5.1   
Hardware: x86_64   
OS: Linux   
Whiteboard: infra
Fixed In Version: ovirt-3.5.1_rc1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1154607 (view as bug list) Environment:
Last Closed: 2015-01-21 16:06:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1154607, 1156434    

Description Tim Speetjens 2014-10-10 14:23:00 UTC
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:

Comment 1 Liran Zelkha 2014-10-13 05:47:46 UTC
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.

Comment 3 Sandro Bonazzola 2015-01-15 14:15:47 UTC
This is an automated message: 
This bug should be fixed in oVirt 3.5.1 RC1, moving to QA

Comment 4 Sandro Bonazzola 2015-01-21 16:06:46 UTC
oVirt 3.5.1 has been released. If problems still persist, please make note of it in this bug report.