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.
This should be revisited in 3.6.0 after the RFE describing in bug 1142762 is done.
*** This bug has been marked as a duplicate of bug 1141543 ***
I agree. The query is terrible. I'm working on a trying to use a UNION ALL instead of UNION - will require fine tuning...