Project

General

Profile

Bug #29447

Filter builds taxonomy search filter inefficiently

Added by Adam Ruzicka 5 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Users, Roles and Permissions
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

If a filter supports taxonomy filtering and the role has many taxonomies assigned then the resulting search query could look like

(organization_id = 1 OR organization_id = 2 OR organization_id = 3) AND (location_id = 1 or location_id = 2)

However scoped search support using the IN operator, so we could get a more compact query, something along the lines of

organization_id ^ (1,2,3) AND location_id ^ (1,2)


Related issues

Blocked by Foreman - Refactor #29532: Update scoped_search to 4.1.8Closed

Associated revisions

Revision 72209166 (diff)
Added by Adam Ruzicka 4 months ago

Fixes #29447 - Build more efficient taxonomy search for filters

If a filter supported taxonomy filtering and the role had many taxonomies
assigned then the resulting search query consisted of many id comparisons joined
together with ORs. This commit generates more efficient query by performing the
search as id IN (...).

History

#1 Updated by The Foreman Bot 5 months ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/7553 added

#2 Updated by Anonymous 4 months ago

#3 Updated by The Foreman Bot 4 months ago

  • Fixed in Releases 2.1.0 added

#4 Updated by Tomer Brisker 4 months ago

  • Category set to Users, Roles and Permissions

#5 Updated by Adam Ruzicka 4 months ago

  • Status changed from Ready For Testing to Closed

Also available in: Atom PDF