v.20.11New Feature
Add log_queries_min_query_duration_ms Setting for Query Logging
Addlog_queries_min_query_duration_ms, only queries slower than the value of this setting will go toquery_log/query_thread_log(i.e. something likeslow_query_login mysql). #16529 (Azat Khuzhin).
Why it matters
This feature helps users monitor and analyze slow queries by reducing noise in query logs. By logging only queries exceeding a specified duration, it improves efficiency in identifying performance bottlenecks similar to MySQL's slow query log.How to use it
Set thelog_queries_min_query_duration_ms parameter to a duration in milliseconds. Queries with execution time longer than this value will be logged to query_log and query_thread_log. For example:SET log_queries_min_query_duration_ms = 1000;This configuration logs only queries running longer than 1000 milliseconds.