Details
Assignee
UnassignedUnassignedReporter
Marko SuticMarko SuticLabels
Needs QA
YesAffects versions
Priority
Medium
Details
Details
Assignee
Unassigned
UnassignedReporter
Marko Sutic
Marko SuticLabels
Needs QA
Yes
Affects versions
Priority
Smart Checklist
Smart Checklist
Smart Checklist
Created February 20, 2024 at 1:42 PM
Updated March 6, 2024 at 9:24 AM
When configuring the server with the following settings:
slow_query_log=ON long_query_time=0 log_slow_rate_limit=10 log_slow_rate_type=query slow_query_log_always_write_time=0.01
The server should log information regarding the slow query rate only for queries where the specified rate limit is exceeded. However, the server currently outputs the following message for every query execution in the slow log, irrespective of whether the rate limit is actually applied:
As this query has execution time over 10 msec it will be logged every time so “
# Log_slow_rate_type: query Log_slow_rate_limit: 10
“ is misleading as it suggests that the rate limit is being applied to all queries, even when it is not. This could potentially lead to confusion and misinterpretation of the slow query log data. Also it adds additional bloat to the slow log.# Time: 2024-02-20T13:28:57.929847Z # User@Host: root[root] @ localhost [] Id: 11 # Schema: testdb Last_errno: 0 Killed: 0 # Query_time: 0.187914 Lock_time: 0.000008 Rows_sent: 1 Rows_examined: 0 Rows_affected: 0 Bytes_sent: 62 # Tmp_tables: 0 Tmp_disk_tables: 0 Tmp_table_sizes: 0 # InnoDB_trx_id: 0 # Full_scan: Yes Full_join: No Tmp_table: No Tmp_table_on_disk: No # Filesort: No Filesort_on_disk: No Merge_passes: 0 # InnoDB_IO_r_ops: 0 InnoDB_IO_r_bytes: 0 InnoDB_IO_r_wait: 0.000000 # InnoDB_rec_lock_wait: 0.000000 InnoDB_queue_wait: 0.000000 # InnoDB_pages_distinct: 7 # Log_slow_rate_type: query Log_slow_rate_limit: 10 SET timestamp=1708435737; select count(*) from test;
Expected Behavior:
The
Log_slow_rate_type
andLog_slow_rate_limit
messages should only be logged for queries where the specified rate limit is exceeded. Queries that do not meet the rate limit criteria should not include these messages in the slow query log.