Project

General

Profile

Bug #8593

N+1 query on Puppet class index, looking up class_params

Added by Dominic Cleal almost 7 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Database
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

http://0.0.0.0:3000/puppetclasses
N+1 Query detected
  Puppetclass => [:class_params]
  Add to your finder: :include => [:class_params]
N+1 Query method call stack
  /home/dcleal/code/foreman/foreman/app/views/puppetclasses/index.html.erb:30:in `block in _app_views_puppetclasses_index_html_erb__247937742040578848_83062380'
  /home/dcleal/code/foreman/foreman/app/views/puppetclasses/index.html.erb:15:in `_app_views_puppetclasses_index_html_erb__247937742040578848_83062380'
  /home/dcleal/code/foreman/foreman/app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
  /home/dcleal/code/foreman/foreman/lib/middleware/catch_json_parse_errors.rb:9:in `call'

This seems to be coming from the check for whether to display the "Override all parameters" action button, which checks for overridden lookup keys.

Associated revisions

Revision 0e5fefb0 (diff)
Added by Tomer Brisker over 6 years ago

Fixes #8593 - remove N+1 queries on puppetclass index page

Revision 9993f48d (diff)
Added by Tomer Brisker over 6 years ago

Fixes #8593 - remove N+1 queries on puppetclass index page

(cherry picked from commit 0e5fefb087492c926e32417039528d0a105d51a0)

History

#1 Updated by Dominic Cleal almost 7 years ago

Intermittently I also see:

user: dcleal
http://0.0.0.0:3000/puppetclasses
N+1 Query detected
  Puppetclass => [:config_group_classes]
  Add to your finder: :include => [:config_group_classes]
N+1 Query method call stack
  /home/dcleal/code/foreman/foreman/app/models/puppetclass.rb:89:in `host_ids_from_config_groups'
  /home/dcleal/code/foreman/foreman/app/models/puppetclass.rb:95:in `all_hostgroups'
  /home/dcleal/code/foreman/foreman/app/views/puppetclasses/index.html.erb:23:in `block in _app_views_puppetclasses_index_html_erb__247937742040578848_70301942862740'
  /home/dcleal/code/foreman/foreman/app/views/puppetclasses/index.html.erb:15:in `_app_views_puppetclasses_index_html_erb__247937742040578848_70301942862740'
  /home/dcleal/code/foreman/foreman/app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
  /home/dcleal/code/foreman/foreman/lib/middleware/catch_json_parse_errors.rb:9:in `call'

#2 Updated by The Foreman Bot over 6 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/2280 added
  • Pull request deleted ()

#3 Updated by Tomer Brisker over 6 years ago

  • Assignee changed from Dominic Cleal to Tomer Brisker

#4 Updated by Anonymous over 6 years ago

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

#5 Updated by Dominic Cleal over 6 years ago

  • Legacy Backlogs Release (now unused) set to 50

Also available in: Atom PDF