-
Notifications
You must be signed in to change notification settings - Fork 262
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
perf(sync): Reduce db operations for accounts without CONDSTORE #9235
Conversation
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.
The speedup is unparalleled
https://blackfire.io/profiles/compare/e2ee40f6-f178-401e-a403-f1f791907144/graph
🚀
lib/Db/MessageMapper.php
Outdated
->set('updated_at', $queryFalse->createNamedParameter($this->timeFactory->getTime(), IQueryBuilder::PARAM_INT)) | ||
->where($queryFalse->expr()->andX( | ||
$queryFalse->expr()->in('uid', $queryFalse->createParameter('uids')), | ||
$queryFalse->expr()->eq('mailbox_id', $queryFalse->createNamedParameter($mailboxId, IQueryBuilder::PARAM_INT)) |
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 experiment with: AND flag=1
to lower the number of accessed rows and hopefully the transaction size (for rollbacks and for replication)
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.
Seems worth pursuing
Diff to the current HEAD
https://blackfire.io/profiles/compare/797f6164-4438-4c43-bcde-8d18dbd18b76/graph
Diff to main
https://blackfire.io/profiles/compare/eaa6c793-1f5b-4793-b13d-ea14a5b9ca20/graph
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.
✅
2a391b4
to
2dddfae
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.
Please use modern array syntax
🚀
Signed-off-by: Johannes Merkel <[email protected]>
2dddfae
to
413dfbb
Compare
Hello there, We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process. Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6 Thank you for contributing to Nextcloud and we hope to hear from you soon! |
Fix: #6341
Queries (only related) with open mail app for 40min (approx. 170 mails in the mailbox)
before:
after:
(So usually there are 2 queries per flag (138) (set true and set false). seen and notjunk are the only ones with doubled queries because for the other flags, either all mails or no mail have the flag in this specific mailbox.)