Bug 913295

Summary: FindByVirtUUID causing high DB load
Product: [Community] Candlepin Reporter: Andrew Edwards <aedwards>
Component: candlepinAssignee: Bryan Kearney <bkearney>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 0.9CC: bkearney, tpfromme
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-25 15:25:50 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:
Bug Depends On:    
Bug Blocks: 863175    

Description Andrew Edwards 2013-02-20 21:34:04 UTC
Description of problem:
Customers with virtual guest are causing high load on the database.
*bugzilla created for historical purpose, issue already addressed*

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


How reproducible:
100%

Steps to Reproduce:
1. Populate a candlepin instance wiht a large number of consumers/consumer facts (9 million rows in our environment for facts)
2. Create a consumer with guest
3. Update consumer with new guest
  
Actual results:
Updating consumere may time out or take an extremely long time. Taking several minutes in our prod environment.

Expected results:
Updating consumers with virtual guest on candlepin instances with large number of consumer facts has similar performance to customers without guests.

Additional info:

Comment 1 Bryan Kearney 2013-02-20 21:36:42 UTC
commit 15589772c0e1265606991cd26c4abfbc467dd71b
Author: Bryan Kearney <bkearney>
Date:   Mon Feb 18 14:11:04 2013 -0500

    Improve the performance is checking for guests for a given host.
    
    This patch removes a sub-select from the query in lieu of using joins. Joins tend to be much more performant. This does hardcode the table 
    
    During the research, it was pointed out that this query should facter in the owner to handle the cases where two owners have guests witht h