Project

General

Profile

Actions

Bug #26504

closed

Search Hosts by owner = current_user is very inefficient

Added by Timo Goebel about 5 years ago. Updated about 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Search
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

When a user is a member of four groups and the groups each have a role that allows view_hosts access with a "owner = current_user" search condition, page loading is very slow.
For every group the user leaves, the requests get faster.

This gist contains a request log from api/hosts/redacted.example.com.

https://gist.github.com/timogoebel/91bc1b6af28a1a6cdb598d713c3dc264/raw/0c33d1e7d8c379f52ca958641472828bcc6113a4/api-cleaned-sql.txt

The (very simple) request took 30 seconds to be generated.

Actions #1

Updated by The Foreman Bot about 5 years ago

  • Status changed from New to Ready For Testing
  • Assignee set to Timo Goebel
  • Pull request https://github.com/theforeman/foreman/pull/6636 added
Actions #2

Updated by Tomer Brisker about 5 years ago

  • Fixed in Releases 1.22.0 added
Actions #3

Updated by Timo Goebel about 5 years ago

  • Status changed from Ready For Testing to Closed
Actions

Also available in: Atom PDF