Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

slow query log includes even queries that are fast because it includes time spent waiting for lock

is there a way to exclude the time spent waiting for the lock so I can see only the queries that are actually expensive?

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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:

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading