0

Building a MySQL DataBase with GCP's CloudSQL. To check Slow Query in MySQL, we have enabled the following labels

[Label]

slow_query_log: on
log_output: file
long_query_time: 3

After configuring the above settings, I checked the mysql-slow.log of the relevant MySQL file in the Log Explorer, but it was recorded as a slow query with a query_time of less than 3 seconds, and I cannot check the slow query as configured in the Log Explorer. I can't see the configured slow query in the log explorer.

What is the problem? Thank you very much for your help.

1 Answers1

0

There are other settings to check:

SHOW VARIABLES LIKE 'log_slow%';
SHOW VARIABLES LIKE 'log%indexes';

I think log_queries_not_using_indexes is especially useless because it usually tags small tables. If the tables will always be small and the queries are "fast enough", then the slow log is simply being cluttered with this reminder.

Rick James
  • 135,179
  • 13
  • 127
  • 222