Project

General

Profile

Actions

Bug #11474

closed

Fix Katello N+1 Queries

Added by Stephen Benjamin over 8 years ago. Updated over 4 years ago.

Status:
Rejected
Priority:
Normal
Assignee:
-
Category:
Performance
Target version:
-
Difficulty:
Triaged:
Yes
Fixed in Releases:
Found in Releases:

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 #1

Updated by Eric Helms over 8 years ago

  • Assignee set to Stephen Benjamin
  • translation missing: en.field_release set to 70
  • Triaged changed from No to Yes
Actions #2

Updated by Justin Sherrill over 8 years ago

  • translation missing: en.field_release changed from 70 to 86
Actions #3

Updated by Eric Helms about 8 years ago

  • translation missing: en.field_release changed from 86 to 143
Actions #4

Updated by Adam Price almost 8 years ago

  • Category set to Performance
Actions #5

Updated by Justin Sherrill almost 8 years ago

  • translation missing: en.field_release changed from 143 to 114
Actions #6

Updated by Stephen Benjamin over 7 years ago

  • Assignee deleted (Stephen Benjamin)
Actions #7

Updated by John Mitsch over 4 years ago

  • Status changed from New to Rejected
  • Target version deleted (Katello Backlog)

Thanks for reporting this issue. This issue was created over 4 years ago and hasn't seen an update in 1 year. We are closing this in an effort to keep a realistic backlog. Please open up a new issue that includes a link to this issue if you feel this still needs to be addressed. We can then triage the new issue and reassess.

Actions

Also available in: Atom PDF