Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up query #16110

Merged
merged 2 commits into from
May 10, 2024
Merged

Conversation

hennevogel
Copy link
Member

@hennevogel hennevogel commented May 8, 2024

Reduce the amount of tables that have to be materialized for getting involved packages / requests.

@github-actions github-actions bot added the Frontend Things related to the OBS RoR app label May 8, 2024
With those two methods we are checking for a maintainer relationship with
Project/Packages for the user.

The Project/Package default scope hides Project that are access disabled and
where the user has *no* maintainer relationship to.

So both *can not* be true are the same time. No need to skip hidden projects in
the query.
By running the involved_projects/involved_packages queries
up front, this reduces the amount of temporary tables that have
to be populated from 16(!) to 4.
@hennevogel hennevogel force-pushed the refactoring/user-requests-queries branch from 5f72912 to 319fed1 Compare May 8, 2024 15:16
Copy link
Contributor

@saraycp saraycp left a comment

Choose a reason for hiding this comment

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

LGTM, just a typo in the commit message "So both can not be true are at the same time"

@srbaker
Copy link
Contributor

srbaker commented May 8, 2024

Looks reasonable. Is there any way to test this, or demonstrate that it does what we expect in a repeatable way? Those kinds of tests can be expensive, though.

@hennevogel
Copy link
Member Author

Is there any way to test this, or demonstrate that it does what we expect in a repeatable way?

I'm afraid the only reasonable way is to run User.find_by(login: 'yourlogin').requests.explain with and without this.

@saraycp saraycp merged commit d5573df into openSUSE:master May 10, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Frontend Things related to the OBS RoR app
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants