Project

General

Profile

Bug #11474

Fix Katello N+1 Queries

Added by Stephen Benjamin almost 4 years ago. Updated about 1 year ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Performance
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Pull request:
Team Backlog:
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'

History

#1 Updated by Eric Helms almost 4 years ago

  • Assignee set to Stephen Benjamin
  • Legacy Backlogs Release (now unused) set to 70
  • Triaged changed from No to Yes

#2 Updated by Justin Sherrill almost 4 years ago

  • Legacy Backlogs Release (now unused) changed from 70 to 86

#3 Updated by Eric Helms over 3 years ago

  • Legacy Backlogs Release (now unused) changed from 86 to 143

#4 Updated by Adam Price about 3 years ago

  • Category set to Performance

#5 Updated by Justin Sherrill about 3 years ago

  • Legacy Backlogs Release (now unused) changed from 143 to 114

#6 Updated by Stephen Benjamin almost 3 years ago

  • Assignee deleted (Stephen Benjamin)

Also available in: Atom PDF