Skip to content

[26.0] Fix slow get_private_role_user_emails_dict query#22307

Merged
mvdbeek merged 1 commit intogalaxyproject:release_26.0from
mvdbeek:fix_slow_get_private_role_user_emails_dict
Apr 1, 2026
Merged

[26.0] Fix slow get_private_role_user_emails_dict query#22307
mvdbeek merged 1 commit intogalaxyproject:release_26.0from
mvdbeek:fix_slow_get_private_role_user_emails_dict

Conversation

@mvdbeek
Copy link
Copy Markdown
Member

@mvdbeek mvdbeek commented Mar 30, 2026

by passing role_ids filter

The function was doing a full table scan of all private role-to-email mappings on every call, even though each caller only needs a small subset. On large instances like usegalaxy.org this scans hundreds of thousands of rows unnecessarily.

Pass role_ids at all non-admin call sites so the query uses an IN clause instead of scanning the entire user_role_association table.

Fixes #20469

How to test the changes?

(Select all options that apply)

  • I've included appropriate automated tests.
  • This is a refactoring of components with existing test coverage.
  • Instructions for manual testing are as follows:
    1. [add testing steps and prerequisites here if you didn't write automated tests covering all your changes]

License

  • I agree to license these and all my past contributions to the core galaxy codebase under the MIT license.

…filter

The function was doing a full table scan of all private role-to-email
mappings on every call, even though each caller only needs a small
subset. On large instances like usegalaxy.org this scans hundreds of
thousands of rows unnecessarily.

Pass role_ids at all non-admin call sites so the query uses an IN clause
instead of scanning the entire user_role_association table.

Fixes galaxyproject#20469
Fixes GALAXY-MAIN-11Q0
@mvdbeek mvdbeek force-pushed the fix_slow_get_private_role_user_emails_dict branch 2 times, most recently from 859cdcf to 2d1a47a Compare March 30, 2026 21:15
Copy link
Copy Markdown
Member

@jdavcs jdavcs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense, thank you! Although I can't remember why we returned the full set of private user/role associations. Probably just an oversight.

@mvdbeek mvdbeek merged commit d789cbc into galaxyproject:release_26.0 Apr 1, 2026
55 of 57 checks passed
@github-project-automation github-project-automation bot moved this from Needs Review to Done in Galaxy Dev - weeklies Apr 1, 2026
@ahmedhamidawan ahmedhamidawan modified the milestones: 26.1, 26.0 Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

3 participants