Slow UI (>20seconds to load page) Composite Content-view -> Adding Content Views
Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1120765
Description of problem:
Adding content-views to composite content-view is slow. Every time I attempt to add an individual content-view to a composite content-view the UI reloads the entire list of content-views available to be added. In my environment with 100 content-views this results in a >20s load time on the UI.
Version-Release number of selected component (if applicable):
Sat 6.0.3 Beta
RHEL 6.5 2.6.32-431.20.3
Steps to Reproduce:
1. Sat 6.0.3 with manifest uploaded, content synced, custom content synced, and content views published/promoted
2. Create Composite Content-view and navigate to Content-Views Tab -> Add (Wait for page to load) with enough content-views this page will take longer than 20 seconds to load.
The page takes more than 20 seconds to load.
I would expect the page load to take less than 20 seconds.
A grep against the captured foreman/production log shows:
- grep "CACHE" production.log -c
- grep "SELECT" production.log -c
- grep "Completed" production.log
Completed 200 OK in 23781ms (Views: 22595.7ms | ActiveRecord: 681.8ms)
^ Greater than 20 seconds to load the page and a large number of queries to load the page as well.
This problem becomes more noticeable as an individual is adding individual content-views as the page reloads each time "+ Add Content Views" is pressed
Fixes #9534: fix N+1 queries on content view index.
The content views were slow to load in the composite list/add
pages because of several N+1 queries. This commit fixes the N+1s
on content view index.