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.