Project

General

Profile

Bug #29447

Filter builds taxonomy search filter inefficiently

Added by Adam Ruzicka 7 months ago. Updated 6 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

Related to foreman-tasks - Bug #30797: Postgres usage spikes and disk space completely filled up, when non-admin select Monitor -> TasksRejected
Related to Foreman - Bug #30847: Filters needs to rebuild the taxonomy_searchClosed
Blocked by Foreman - Refactor #29532: Update scoped_search to 4.1.8Closed

Associated revisions

Revision 72209166 (diff)
Added by Adam Ruzicka 6 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 7 months ago

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

#2 Updated by Anonymous 6 months ago

#3 Updated by The Foreman Bot 6 months ago

  • Fixed in Releases 2.1.0 added

#4 Updated by Tomer Brisker 6 months ago

  • Category set to Users, Roles and Permissions

#5 Updated by Adam Ruzicka 6 months ago

  • Status changed from Ready For Testing to Closed

#6 Updated by Ondřej Ezr about 1 month ago

  • Related to Bug #30797: Postgres usage spikes and disk space completely filled up, when non-admin select Monitor -> Tasks added

#7 Updated by Ondřej Ezr about 1 month ago

  • Related to Bug #30847: Filters needs to rebuild the taxonomy_search added

Also available in: Atom PDF