Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1545068

Summary: possibly missing index at host_classes table
Product: Red Hat Satellite Reporter: Jan Hutař <jhutar>
Component: PuppetAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED NOTABUG QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: high    
Version: 6.3.0CC: cdonnell, jhutar, oprazak, psuriset, sbadhwar
Target Milestone: UnspecifiedKeywords: Performance, PrioBumpGSS, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-08-28 05:54:57 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:
Attachments:
Description Flags
index migration none

Description Jan Hutař 2018-02-14 08:06:04 UTC
Description of problem:
Running 6.3.0 with Puppet 4 and testing performance of applying multiple Puppet modules at clients concurrently (~20 modules, ~700 clients, ~200 is a maximum concurrency). Noticed that host_status table is being scanned sequentially sometimes (although we have not observed that as a performance bottleneck).


Version-Release number of selected component (if applicable):
satellite-6.3.0-23.0.el7sat.noarch
puppetserver-2.8.0-1.el7sat.noarch


How reproducible:
always


Steps to Reproduce:
1. Work with puppet4 and check ratio of sequential to index scans on tables
   # su - postgres -c "psql foreman"
   foreman=# SELECT relname, seq_scan + idx_scan number_of_uses, 100 * idx_scan / (seq_scan + idx_scan) percent_of_times_index_used, n_live_tup rows_in_table FROM pg_stat_user_tables WHERE seq_scan + idx_scan > 0 ORDER BY n_live_tup DESC;


Actual results:
                        relname                         | number_of_uses | percent_of_times_index_used | rows_in_table 
--------------------------------------------------------+----------------+-----------------------------+---------------
 [...]
 host_classes                                           |         342747 |                          34 |         11520
 [...]


Expected results:
Should be 100% of index scans


Additional info:
Noticed that when working on this experiment:

https://github.com/redhat-performance/satperf/blob/master/run-puppet-workload.sh

Comment 2 Ondřej Pražák 2018-08-13 10:41:27 UTC
After running the reproducing query, it shows no table uses 100% index scans, so why this one should if no performance bottlenecks were detected?

Comment 3 Jan Hutař 2018-08-22 05:17:59 UTC
How do I create the index? I can measure if there is some performance impact.

Comment 4 Ondřej Pražák 2018-08-22 08:53:25 UTC
Created attachment 1477822 [details]
index migration

Drop this file into /usr/share/foreman/db/migrate
run foreman-rake db:migrate to create index
run foreman-rake db:migrate:down VERSION=20180822080558 to remove it

Comment 5 Ondřej Pražák 2018-08-22 08:55:29 UTC
I added a migration that will create an index for you.