Bug 984962 - SearchQuery generates slow query on vds_with_tags
Summary: SearchQuery generates slow query on vds_with_tags
Status: CLOSED DUPLICATE of bug 984973
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine
Version: unspecified
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
: 3.4.0
Assignee: Liran Zelkha
QA Contact:
Whiteboard: infra
Depends On:
TreeView+ depends on / blocked
Reported: 2013-07-16 13:39 UTC by Liran Zelkha
Modified: 2016-02-10 19:19 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2013-11-05 13:20:44 UTC
oVirt Team: Infra
Target Upstream Version:

Attachments (Terms of Use)

Description Liran Zelkha 2013-07-16 13:39:51 UTC
Description of problem:
When AutoRecoveryManager runs it generates a query to select all VDS with a specific group name. This query is slow and can be optimized easily.

Version-Release number of selected component (if applicable):

How reproducible:
Run engine.

Steps to Reproduce:
1. Connect with a profiler to engine, and examine queries.

Actual results:
Generated query is:
SELECT * FROM (SELECT * FROM vds WHERE ( vds_id IN (SELECT vds_with_tags.vds_id FROM  vds_with_tags   WHERE  vds_with_tags.vds_group_name LIKE 'Default' ))  ORDER BY vds_name ASC ,vds_name ASC ) as T1 OFFSET (1 -1) LIMIT 2147483647

Expected results:
Should be SELECT * FROM vds WHERE vds_group_name LIKE 'Default' ORDER BY vds_name ASC as T1 OFFSET (1 -1) LIMIT 2147483647

Additional info:

Comment 1 Liran Zelkha 2013-11-05 13:20:44 UTC

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

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