Bug 1380486

Summary: free form search is very slow, not excluding installed packages and applicable errata
Product: Red Hat Satellite Reporter: Chris Duryee <cduryee>
Component: Content ManagementAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: jcallaha
Severity: high Docs Contact:
Priority: high    
Version: 6.2.0CC: bbuckingham, bkearney, cduryee, csulekha, dmoessne, egolov, inecas, jcallaha, jhutar, mmccune, mmello, oshtaier, pierre-yves.goubet, pmoravec, psuriset, zhunting
Target Milestone: UnspecifiedKeywords: Performance, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: tfm-rubygem-katello-3.0.0.82-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1385764 (view as bug list) Environment:
Last Closed: 2016-11-10 08:14:06 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: 1385764, 1399395    
Attachments:
Description Flags
verification video none

Description Chris Duryee 2016-09-29 18:12:43 UTC
Description of problem:

The freeform search can be slow since it includes installed packages and applicable errata by default.

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


Steps to Reproduce:
1. set up a number of hosts that are reporting their installed packages (> 100 hosts at least)
2. use the freeform search box to search for a string

Actual results:

search can take an excessively long time, many seconds


Expected results: search should be reasonably fast


Additional info:

If you see a query like this in the postgres log, it's likely this bug:

2016-09-27 13:34:23 EDT LOG:  duration: 103464.745 ms  execute <unnamed>: SELECT  DISTINCT "hosts"."id", "hosts"."name" AS alias_0 FROM "hosts" LEFT OUTER JOIN "models" ON "models"."id" = "hosts"."model_id" LEFT OUTER JOIN....


the query is extremely long, but will contain references to 'katello_installed_packages'

Comment 3 Bryan Kearney 2016-09-29 20:19:34 UTC
Upstream bug assigned to jsherril

Comment 4 Bryan Kearney 2016-09-29 20:19:37 UTC
Upstream bug component is Other

Comment 5 Bryan Kearney 2016-09-29 20:19:39 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue http://projects.theforeman.org/issues/16647 has been resolved.

Comment 13 jcallaha 2016-11-06 21:26:52 UTC
Verified in Satellite 6.2.4.

System had 220 content hosts, each with approximately 150 installable errata. Search time did not lag behind, after all errata applicability had been completed (general performance hit during mass registration). Each search was completed well under a second. I will upload a verification video, however the capture didn't turn out well.

Comment 14 jcallaha 2016-11-06 21:27:38 UTC
Created attachment 1217836 [details]
verification video

Comment 16 errata-xmlrpc 2016-11-10 08:14:06 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:2699