-
Notifications
You must be signed in to change notification settings - Fork 768
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
periodic infoSchemaAutoIncrementQuery can sometimes be very slow; merge fix from PMM #725
Comments
Signed-off-by: Colin Kelley <colindkelley@gmail.com>
…_auto_increment-with-straight_join issue-#725: use STRAIGHT_JOIN in infoSchemaAutoIncrementQuery
PR is merged. |
Not sure if this is related, but i'm getting the following errors on the latest and on 0.12.1 versions.
|
Host operating system: output of
uname -a
mysqld_exporter version: output of
mysqld_exporter --version
0.12.1
MySQL server version
5.7
mysqld_exporter command line flags
What did you do that produced an error?
The periodic infoSchemaAutoIncrementQuery that is run by the
mysqld_exporter
can sometimes be extremely slow, especially if you have a lot of tables and columns. This bit us many years ago and we found we could force MySQL to use its normal high-performance query by usingSTRAIGHT_JOIN
from the columns to the tables:We have been using this fix for 4 years without issue. About 3.5 years ago we submitted that fix into the PMM fork of the prometheus
mysqld_exporter
and it has been working without issue there ever since. However we recently had a new project use thisprometheus/mysqld_exporter
version of the code and issue popped up there after a few months.Here is the PMM ticket: https://jira.percona.com/browse/PMM-4001
And here is the PMM PR: https://github.com/percona/mysqld_exporter/pull/48/files
Here is a PR to to apply the fix here as well: #726
What did you expect to see?
The
infoSchemaAutoIncrementQuery
typically runs in < 1 sec.What did you see instead?
With the original query, MySQL sometimes chooses a bad query plan that start with the tables and then joins to the columns, causing the
infoSchemaAutoIncrementQuery
to take > 1 minute to complete in our environment [7 schemas, 840 tables, 41,000 columns]. That's disastrous with a polling interval of 1 minute or less, as the queries never return in time and actually stack up until themysqld_exporter
runs out of memory and is OOM-killed.The text was updated successfully, but these errors were encountered: