-
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
Log slow MySQL queries on CI #6049
Conversation
Signed-off-by: Christoph Wurst <[email protected]>
ecf863e
to
66d2974
Compare
- name: Enable slow mysql query logs | ||
if: ${{ matrix.db == 'mysql' }} | ||
run: | | ||
echo "SET GLOBAL log_queries_not_using_indexes = 1;" | mysql -h 127.0.0.1 -u root -pmy-secret-pw |
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.
on CI queries aren't slow enough to trigger a slow query as per https://mariadb.com/kb/en/slow-query-log-overview/, so I've added this line to show anything that doesn't use an index.
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.
Any clue if that shows queries where an index exists but is not used because it matches 90% of the rows anyway and stuff like this?
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.
That is indeed the case. So if your tests clear a table with DELETE FROM xyz
it will show up.
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.
Clever 👍
Hopefully you don't get too much false positives
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.
Great idea!
To help us with #5835