-
Notifications
You must be signed in to change notification settings - Fork 274
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
fix: Split query to fetch board ids to avoid slow query join #4906
Conversation
Passing run #1147 ↗︎
Details:
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
c17cf92
to
07658c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest I don't understand the change. If I read the code changes correctly, one SQL query is split into two now, but the second new query looks exactly like the old one to me.
The first new query doesn't have the "Shared to [user/groups/circles]" condition, so it returns only the owned boards. But the second still has both conditions: owned boards and shared boards.
Maybe you meant to remove the "Owned by the user" condition from the second query? 🤔
It's well possible that I just don't understand the code. DB queries are certainly not my field of expertise 😬
07658c3
to
c3ebee3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes look good to me now 😊
This comment was marked as resolved.
This comment was marked as resolved.
Signed-off-by: Julius Härtl <[email protected]>
c3ebee3
to
fe319c8
Compare
/backport to stable27 |
/backport to stable26 |
The backport to stable27 failed. Please do this backport manually. # Switch to the target branch and update it
git checkout stable27
git pull origin stable27
# Create the new backport branch
git checkout -b fix/foo-stable27
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable27 More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport |
The backport to stable26 failed. Please do this backport manually. # Switch to the target branch and update it
git checkout stable26
git pull origin stable26
# Create the new backport branch
git checkout -b fix/foo-stable26
# Cherry pick the change from the commit sha1 of the change against the default branch
# This might cause conflicts. Resolve them.
git cherry-pick abc123
# Push the cherry pick commit to the remote repository and open a pull request
git push origin fix/foo-stable26 More info at https://docs.nextcloud.com/server/latest/developer_manual/getting_started/development_process.html#manual-backport |
Summary
Some over optimization for query count caused this slow query, which does seem to do a full table scan on the boards table (left part of the join):
Doing two queries instead still seems more reasonable as I also couldn't think of a more performant option.