Bug 1131724

Summary: Full table scan of RHQ_CONFIG_UPDATE in delete for RHQ_CONFIG
Product: [Other] RHQ Project Reporter: Elias Ross <genman>
Component: DatabaseAssignee: Thomas Segismont <tsegismo>
Status: CLOSED WONTFIX QA Contact: Mike Foley <mfoley>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 4.9CC: hrupp, tsegismo
Target Milestone: ---   
Target Release: RHQ 4.13   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-16 13:18:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Elias Ross 2014-08-19 23:17:48 UTC
Description of problem:

This query:

delete from RHQ_CONFIG where id in (
   select resourceco1_.CONFIGURATION_ID from
     RHQ_CONFIG_UPDATE resourceco1_, RHQ_RESOURCE resource2_
   where
     resourceco1_.DTYPE='resource' and resourceco1_.CONFIG_RES_ID=resource2_.ID and
     (resourceco1_.CONFIG_RES_ID in (564877)) and
      resourceco1_.CONFIGURATION_ID<>resource2_.RES_CONFIGURATION_ID)

Explain plan:

DELETE STATEMENT	0.0 %
RHQ.RHQ_CONFIG  DELETE	0.0 %
NESTED LOOPS	0.9 %
SYS.VW_NSO_1  VIEW	0.0 %
SORT (UNIQUE)	0.0 %
HASH JOIN	0.0 %	
RHQ.RHQ_RESOURCE  TABLE ACCESS (BY INDEX ROWID)	0.1 %
RHQ.SYS_C0012508  INDEX (UNIQUE SCAN)	0.1 %	
RHQ.RHQ_CONFIG_UPDATE  TABLE ACCESS (FULL)	98.8 %
^^^	
RHQ.SYS_C0012490  INDEX (UNIQUE SCAN)	0.1 %	

My RHQ_CONFIG_UPDATE contains 600,000+ rows.

Actually think the bigger problem is RHQ_CONFIG_UPDATE never seems to be purged. I have rows from 2012 in there...

Comment 1 Elias Ross 2014-08-19 23:37:22 UTC
See Bug 1131726 on the purge process need. Probably okay to do a table scan if the data is being purged.

Comment 2 Thomas Segismont 2014-10-16 13:18:08 UTC
(In reply to Elias Ross from comment #1)
> See Bug 1131726 on the purge process need. Probably okay to do a table scan
> if the data is being purged.

Resource config data purge will be possible when Bug 1131726 is fixed.