Bug 726524

Summary: Consider adding an index for the RHQ_ALERT_CONDITION_LOG.CONDITION_ID to optimize queries.
Product: [Other] RHQ Project Reporter: Robert Buck <rbuck>
Component: Core ServerAssignee: Robert Buck <rbuck>
Status: CLOSED CURRENTRELEASE QA Contact: Mike Foley <mfoley>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0.1CC: hrupp, ian.springer
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-07 19:22:07 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 717358, 725459    

Description Robert Buck 2011-07-28 22:20:53 UTC
The query of concern is:

  select alertCondLog.ID, alertCondLog.CTIME, alertCondLog.VALUE, 
    alertCondLog.ALERT_ID, alertCondLog.CONDITION_ID
    from RHQ_ALERT_CONDITION_LOG alertCondLog, RHQ_ALERT_CONDITION alertCond  
    where alertCondLog.CONDITION_ID = alertCond.ID 
      and alertCond.ALERT_DEFINITION_ID=:1
      and (alertCondLog.ALERT_ID is null)

The cardinality of the RHQ_ALERT_CONDITION_LOG and RHQ_ALERT_CONDITION tables in this case were 2963114 and 5268, respectively.

Comment 1 Robert Buck 2011-08-02 13:53:28 UTC
branch: feature/performance

commit 5b82b1e38bc6df304ae5eb11dfa87a13091c20d5
Author: Robert Buck <buck.robert.j>
Date:   2011-07-28 18:22:40 -0400

    [BZ 726524] Consider adding an index for the RHQ_ALERT_CONDITION_LOG.CONDITION_ID to optimize queries.

Comment 3 Robert Buck 2011-08-08 20:22:18 UTC
Fixed and merge to master in:

6328219f0cb2a251463111bf5f481d92fafc78a6
d7e9e35c5326c1c36f1d323fc5448d703f225bca

Comment 4 Mike Foley 2011-08-11 15:25:51 UTC
verified as follows:  visual inspection of an oracle database to verify the presence of this new index, functional testing of alerts, reviewed server logs looking for sql or hibernate errors (none).

Comment 5 Mike Foley 2012-02-07 19:22:07 UTC
changing status of VERIFIED BZs for JON 2.4.2 and JON 3.0 to CLOSED/CURRENTRELEASE