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

Move recipient delete to separate query #4932

Merged
merged 1 commit into from
Apr 22, 2021

Conversation

rullzer
Copy link
Member

@rullzer rullzer commented Apr 9, 2021

The sub query did not use proper indexes. So now we just fetch the data
and then issue a separate delete statement that can use all the right
indexes. Resulting esp on large setups on a lot better performance.

Now truth be told I did not test this.
Lets see if it is covered by tests :P

Copy link
Member

@ChristophWurst ChristophWurst left a comment

Choose a reason for hiding this comment

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

In theory we have to be careful with IN and literals but I guess more than 1000 recipients per messages is rather unlikely

lib/Db/MessageMapper.php Outdated Show resolved Hide resolved
lib/Db/MessageMapper.php Outdated Show resolved Hide resolved
@rullzer
Copy link
Member Author

rullzer commented Apr 16, 2021

More reviews

lib/Db/MessageMapper.php Outdated Show resolved Hide resolved
lib/Db/MessageMapper.php Outdated Show resolved Hide resolved
The sub query did not use proper indexes. So now we just fetch the data
and then issue a separate delete statement that can use all the right
indexes. Resulting esp on large setups on a lot better performance.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
@ChristophWurst ChristophWurst merged commit 69a19c3 into master Apr 22, 2021
@ChristophWurst ChristophWurst deleted the enh/recipients_delete_sep_query branch April 22, 2021 10:20
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.

4 participants