Project

General

Profile

Refactor #8790

N+1 on user list page

Added by Tomer Brisker almost 7 years ago. Updated over 3 years ago.

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

Description

I get the following on the users list page:

N+1 Query detected
  User => [:cached_usergroups]
  Add to your finder: :include => [:cached_usergroups]
N+1 Query method call stack
  /home/tbrisker/foreman/app/models/user.rb:138:in `admin?'
  /home/tbrisker/foreman/app/views/users/index.html.erb:23:in `block in _app_views_users_index_html_erb___2625566761564459765_130883920'
  /home/tbrisker/foreman/app/views/users/index.html.erb:17:in `_app_views_users_index_html_erb___2625566761564459765_130883920'
  /home/tbrisker/foreman/app/models/concerns/foreman/thread_session.rb:33:in `clear_thread'
  /home/tbrisker/foreman/lib/middleware/catch_json_parse_errors.rb:9:in `call'

Associated revisions

Revision 27267aec (diff)
Added by Tomer Brisker almost 7 years ago

Fixes #8790 - Fix N+1 query on user list page

History

#1 Updated by The Foreman Bot almost 7 years ago

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

#2 Updated by Anonymous almost 7 years ago

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

#3 Updated by Dominic Cleal almost 7 years ago

  • Category set to Database
  • Legacy Backlogs Release (now unused) set to 28

Also available in: Atom PDF