Project

General

Profile

Bug #9564

Content View index page takes a long time to list

Added by Walden Raines about 8 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
High
Assignee:
Category:
API
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:
Red Hat JIRA:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1177609
Description of problem:
Similar to issue BZ1161636 for the ContentViewVersions, also the index of the Content View page takes a long time. See below results on a VM with 4vCPUs and 16MB that it takes 45 seconds to list only 14 CVs:

  1. time curl -K /opt/hoici/etc/curl-hoici.conf -H 'Content-Type: application/json' -d '{"per_page":9999}' -XGET https://localhost/katello/api/v2/organizations/4/content_views > p1.json
real 0m44.786s
user 0m0.201s
sys 0m0.075s
  1. ls l p1.json
    -rw-r--r-
    1 root root 188770 Dec 29 12:02 p1.json
  2. cat p1.json | jq .results[].id | wc -l
    14
  3. cat p1.json | jq .results[].puppet_modules[].id | wc -l
    295
It also contains many (repeated) details about the product sync_plans, which are superfluous information:
  1. cat p1.json | jq .results[].repositories[].product.sync_plan.id | wc -l
    60
  2. cat p1.json | jq .results[].repositories[].product.sync_plan.products[].id 2> /dev/null | wc -l
    258

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

How reproducible:

Steps to Reproduce:
1. Create 10 Products (or use RHEL products)
2. Create 1 Sync plan with all 10 Products
3. Create 50 Puppet modules
4. Create 20 CVs with the products and puppet modules
5. List the CVs

Actual results:

Expected results:
List of CVs returned within 5 seconds

Additional info:
There might be more places where too much detailed information is inherited by including the "show" views of the relations in the index part. Maybe create a index-show and a detailed-show view per resource type. The index-show will be included in the index views or relationship includes. The detailed-show will be used only for the show option to display the resource itself.

Associated revisions

Revision 726b9c4f (diff)
Added by Walden Raines about 8 years ago

Fixes #9564: limit components rabl to fix N+1 queries, BZ 1177609.

There were several N+1 queries because we were including all of the
content view version rabl for components. This commit reduces the fields
we include in the rabl and thus removes N+1 queries, speeding up the page.

http://projects.theforeman.org/issues/9564
https://bugzilla.redhat.com/show_bug.cgi?id=1177609

Revision 20630de3
Added by Walden Raines about 8 years ago

Merge pull request #5054 from waldenraines/9564

Fixes #9564: limit components rabl to fix N+1 queries, BZ 1177609.

History

#1 Updated by The Foreman Bot about 8 years ago

  • Status changed from New to Ready For Testing
  • Target version set to 67
  • Pull request https://github.com/Katello/katello/pull/5054 added
  • Pull request deleted ()

#2 Updated by Eric Helms about 8 years ago

  • Legacy Backlogs Release (now unused) set to 23
  • Triaged changed from No to Yes

#3 Updated by Walden Raines about 8 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF