-
-
Notifications
You must be signed in to change notification settings - Fork 178
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(cleanup): Improve delete orphans SQL query #527
fix(cleanup): Improve delete orphans SQL query #527
Conversation
4ade8ff
to
87ce772
Compare
Original query to delete orphans was terribly slow and was unable to finish within default 15s timeout. Instead of excluding all ids from union, we left join all 3 tables and select only rows that have no joined values in pact_publications or verifications. Additionaly, the query was fixed for mysql. Whenever the Mysql error occures instead of embedded query, ids are fetched and then directly used in delete query.
87ce772
to
8e7e111
Compare
You're a champion. Thank you so much. I'd fixed one of these super inefficient queries, but hadn't gotten around to doing the rest. Sorry about the broken build on master - it's been SUCH a week! |
I've put out a new release with this PR. |
@barthez would you mind accepting my connection request on LinkedIn? I'd love to have a chat! |
I need to revert this PR because I believe it has caused the following errors in our clean logs.
There was obviously some scenario not covered in the tests. I'll try and have a look into it, but not sure when that will be yet. |
* fix(cleanup): Improve delete orphans SQL query Original query to delete orphans was terribly slow and was unable to finish within default 15s timeout. Instead of excluding all ids from union, we left join all 3 tables and select only rows that have no joined values in pact_publications or verifications. Additionaly, the query was fixed for mysql. Whenever the Mysql error occures instead of embedded query, ids are fetched and then directly used in delete query. * fix: Add sql_enable_caller_logging documentation * fix: Fix unreliable spec
* fix(cleanup): Improve delete orphans SQL query (#527) * fix(cleanup): Improve delete orphans SQL query Original query to delete orphans was terribly slow and was unable to finish within default 15s timeout. Instead of excluding all ids from union, we left join all 3 tables and select only rows that have no joined values in pact_publications or verifications. Additionaly, the query was fixed for mysql. Whenever the Mysql error occures instead of embedded query, ids are fetched and then directly used in delete query. * fix: Add sql_enable_caller_logging documentation * fix: Fix unreliable spec * fix: fully qualify pact_version table joins in database clean Co-authored-by: Bartek Bułat <[email protected]>
Original query to delete orphans was terribly slow and was unable to finish within default 15s timeout. Instead of excluding all ids from union, we left join all 3 tables and select only rows that have no joined values in
pact_publications
or verifications.Additionaly, the query was fixed for mysql. Whenever the Mysql error occures instead of embedded query, ids are fetched and then directly used in delete query.
[edit]
Added
sql_enable_caller_logging
configuration documentation as it was causing specs failures.