Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DB table locks on messenger_messages with many failures #52276

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

Merged
merged 1 commit into from
Oct 25, 2023

Conversation

bn-jdcook
Copy link
Contributor

@bn-jdcook bn-jdcook commented Oct 24, 2023

Q A
Branch? 5.4
Bug fix? yes
New feature? no
Deprecations? no
Issues Fix #52273
License MIT

This reorders the query to target the queue_name first and not include any failed messages in the first part of the WHERE clause to help performance.

@bn-jdcook
Copy link
Contributor Author

I am not sure why AppVeyor is failing but it appears to be on all PRs to 5.4.

@OskarStark OskarStark changed the title fix #52273 [doctrine-messenger] DB table locks on messenger_messages … [Medsenger][Doctrine] DB table locks on messenger_messages … Oct 25, 2023
@OskarStark OskarStark changed the title [Medsenger][Doctrine] DB table locks on messenger_messages … [Medsenger][Doctrine] DB table locks on messenger_messages wirh many failures Oct 25, 2023
@OskarStark OskarStark changed the title [Medsenger][Doctrine] DB table locks on messenger_messages wirh many failures [Messenger][Doctrine] DB table locks on messenger_messages wirh many failures Oct 25, 2023
@nicolas-grekas nicolas-grekas changed the title [Messenger][Doctrine] DB table locks on messenger_messages wirh many failures [Messenger][Doctrine] DB table locks on messenger_messages with many failures Oct 25, 2023
@carsonbot carsonbot changed the title [Messenger][Doctrine] DB table locks on messenger_messages with many failures DB table locks on messenger_messages with many failures Oct 25, 2023
@fabpot
Copy link
Member

fabpot commented Oct 25, 2023

Thank you @bn-jdcook.

@fabpot fabpot merged commit b34c4c7 into symfony:5.4 Oct 25, 2023
@bn-jdcook bn-jdcook deleted the fix_52273 branch October 25, 2023 19:16
@antonkomarev
Copy link

antonkomarev commented Oct 25, 2023

@bn-jdcook how does this affect performance? Doesn't the database query planner care about the order of WHERE clauses?

What database are you using? Have you tried to make EXPLAIN to see if the query plan is different?

// I'm not against these changes. Order is more logical now. But I haven't faced such issues in Postgres.

@ghost
Copy link

ghost commented Oct 25, 2023

What database are you using?

I agree a reporter should mention a database he's using when reporting an issue related to the database.

Btw. I really wonder whether a database can create a query plan that knows which AND condition to use first (unless both columns do not differ somehow from database point of view). E.g. how can it know that filtering first by queue_name will be more efficient.

This was referenced Oct 29, 2023
@xabbuh xabbuh mentioned this pull request Oct 29, 2023
@fabpot fabpot mentioned this pull request Oct 29, 2023
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.

5 participants