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

Add lean sync for servers without CONDSTORE #7375

Closed
wants to merge 1 commit into from

Conversation

ChristophWurst
Copy link
Member

Fixes #6341

This updates flags in 20+ queries. Bigger mailboxes require more queries. But still, if you have 150k messages the sync ran 150k updates before, now it runs 20k. If we say that only read/unread and important flags are relevant we can cut it to 600 queries.

It aint much, but it it's an honest optimization.

Todo

  • Doing
  • Testing

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
->where(
$query->expr()->eq('mailbox_id', $query->createNamedParameter($mailbox->getId(), IQueryBuilder::PARAM_INT), IQueryBuilder::PARAM_INT),
$query->expr()->eq($col, $query->createNamedParameter(!$set, IQueryBuilder::PARAM_BOOL), IQueryBuilder::PARAM_BOOL),
$query->expr()->in('uid', $query->createParameter('uids'), IQueryBuilder::PARAM_INT_ARRAY),
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure if possible with all your fancy pancy supported databases

but an index like

('mailbox_id', 'uid') INCLUDING (flag1, flag2, flag3, flag4, flag5, flag6) would allow the filtering to happen mainly on the index level. Without going to the actual data.

@ChristophWurst
Copy link
Member Author

Superseded by #9235

@ChristophWurst ChristophWurst deleted the enhancement/no-condstore-no-problem branch January 29, 2024 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Restructure \OCA\Mail\Db\MessageMapper::updateBulk to run in O(1)
2 participants