is there a way to exclude the time spent waiting for the lock so I can see only the queries that are actually expensive?
2
The slow query log does not count the lock time. It only logs a query if the execution time is at least as great as long_query_time in seconds.
long_query_time
https://dev.mysql.com/doc/refman/8.0/en/slow-query-log.html says:
The time to acquire the initial locks is not counted as execution time.
You may have other options enabled that make queries logged even if they are quick. For example log_queries_not_using_indexes.
Perhaps you have
log_queries_not_using_indexes = ON
I recommend OFF
OFF
More tips: SlowLog
Click here to cancel reply.
2
Answers
The slow query log does not count the lock time. It only logs a query if the execution time is at least as great as
long_query_time
in seconds.https://dev.mysql.com/doc/refman/8.0/en/slow-query-log.html says:
You may have other options enabled that make queries logged even if they are quick. For example log_queries_not_using_indexes.
Perhaps you have
I recommend
OFF
More tips: SlowLog