Actions
Bug #11474
closedFix Katello N+1 Queries
Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
Performance
Target version:
-
Description
There's a bunch of N+1 queries all across Katello. We don't get the nice warnings in the UI in Bastion, but we do get them in the logs.
The products page has a few, for example.
2015-08-24T17:34:37 [app] [W] user: vagrant | /katello/api/products?enabled=true&organization_id=1&page=1&paged=true&search=&sort_by=name&sort_order=ASC | N+1 Query detected | Katello::Provider => [:organization] | Add to your finder: :includes => [:organization] | N+1 Query method call stack | /home/vagrant/foreman/app/controllers/api/v2/base_controller.rb:151:in `disable_json_root' | /home/vagrant/foreman/app/controllers/concerns/application_shared.rb:13:in `set_timezone' | /home/vagrant/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread' | /home/vagrant/foreman/lib/middleware/catch_json_parse_errors.rb:9:in `call' | | /home/vagrant/foreman/app/controllers/api/v2/base_controller.rb:151:in `disable_json_root' | /home/vagrant/foreman/app/controllers/concerns/application_shared.rb:13:in `set_timezone' | /home/vagrant/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread' | /home/vagrant/foreman/lib/middleware/catch_json_parse_errors.rb:9:in `call' 2015-08-24T17:34:37 [app] [W] user: vagrant | /katello/api/products?enabled=true&organization_id=1&page=1&paged=true&search=&sort_by=name&sort_order=ASC | N+1 Query detected | Katello::Repository => [:product] | Add to your finder: :includes => [:product] | N+1 Query method call stack | /home/vagrant/foreman/app/controllers/api/v2/base_controller.rb:151:in `disable_json_root' | /home/vagrant/foreman/app/controllers/concerns/application_shared.rb:13:in `set_timezone' | /home/vagrant/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread' | /home/vagrant/foreman/lib/middleware/catch_json_parse_errors.rb:9:in `call' | | /home/vagrant/foreman/app/controllers/api/v2/base_controller.rb:151:in `disable_json_root' | /home/vagrant/foreman/app/controllers/concerns/application_shared.rb:13:in `set_timezone' | /home/vagrant/foreman/app/models/concerns/foreman/thread_session.rb:32:in `clear_thread' | /home/vagrant/foreman/lib/middleware/catch_json_parse_errors.rb:9:in `call'
Actions