Bug 1168572 - GetDisksVmGuid stored function is inefficient
Summary: GetDisksVmGuid stored function is inefficient
Keywords:
Status: CLOSED DUPLICATE of bug 1141543
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: 3.4.3-1
Hardware: x86_64
OS: Linux
medium
medium
Target Milestone: ovirt-3.6.3
: 3.6.0
Assignee: Allon Mureinik
QA Contact:
URL:
Whiteboard: storage
Depends On: ovirt_refactor_disk_class_hierarchy
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-11-27 10:31 UTC by Tim Speetjens
Modified: 2019-09-12 08:08 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-12-02 12:10:34 UTC
oVirt Team: Storage
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Tim Speetjens 2014-11-27 10:31:00 UTC
Description of problem:
The query used in GetDisksVmGuid is slow

Version-Release number of selected component (if applicable):
RHEV 3.4, but applicable to all versions 

How reproducible:
100%

Steps to Reproduce:
Execute the query with a user that has multiple rights assigned.
Execute explain plan for query with a user that has multiple rights assigned.

Actual results:
Execution of this query is slow using much CPU, and explain plan for this query is bad, when using large dataset.

Expected results:
This query should be more optimized, to avoid using too much CPU

Additional info:
Optimizing it by rewriting the exists clause into a join, doesn't help much, if at all. Other BZs referencing this query have been introduced, and were closed in an errata. However, the query itself hasn't been touched, only the way it is used has been improved.

Comment 1 Allon Mureinik 2014-11-29 07:13:00 UTC
This should be revisited in 3.6.0 after the RFE describing in bug 1142762 is done.

Comment 2 Liran Zelkha 2014-12-02 12:10:34 UTC

*** This bug has been marked as a duplicate of bug 1141543 ***

Comment 3 Liran Zelkha 2014-12-02 12:11:37 UTC
I agree. The query is terrible. I'm working on a trying to use a UNION ALL instead of UNION - will require fine tuning...


Note You need to log in before you can comment on or make changes to this bug.