You can set the verbosity of what's logged to the slow query log by setting the the log_slow_verbosity variable to a combination of the following values:
Query_plan explain Innodb (From MariaDB 10.6.15. Before that this option did nothing) engine. engine (From MariaDB 10.6.15) | Option | Description | Engine |
|---|---|---|
Pages_accessed |
Number of pages accessed from page buffer (innodb-buffer-pool / key cache) | InnoDB |
Pages_updated |
Number of pages updated in memory | InnoDB |
Pages_read_time |
Milliseconds spend reading pages from storage | InnoDB |
Old_rows_read |
Number of retrieval of old versions of rows in the engine (versioning) | InnoDB |
Engine_time |
Milliseconds spent inside engine calls (read_row / read_next_row etc) | All |
full The default value for log_slow_verbosity is ' ', to be compatible with MySQL 5.1.
Multiple options are separated by ','.
log_slow_verbosity is not supported when log_output='TABLE'.
In the future we will add more engine statistics and also support for other engines.
You can define which queries to log to the slow query log by setting the variable log_slow_filter to a combination of the following values:
admin filesort filesort_on_disk full_join full_scan query_cache query_cache_miss tmp_table tmp_table_on_disk Multiple options are separated by ','. If you don't specify any options everything will be logged.
The log_slow_rate_limit variable limits logging to the slow query log by not logging every query (only one query / log_slow_rate_limit is logged). This is mostly useful when debugging and you get too much information to the slow query log.
Note that in any case, only queries that takes longer than log_slow_time or long_query_time' are logged (as before).
© 2023 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/slow-query-log-extended-statistics/