content_image/685366.jpg
compression for messages sent for distributed recovery by the method of state transfer from a donor’s binary log, using the group_replication_recovery_compression_algorithms  and group_replication_recovery_zstd_compression_level  system variables. If you enable binary log transaction compression in a system where these are configured, Group Replication’s message compression can still operate on uncompressed events and on message headers, but its impact is reduced. For more information on message compression for Group Replication, see Section 18.7.3, “Message Compression” . 

## 5.4.5 The Slow Query Log 

The slow query log consists of SQL statements that take more than long_query_time  seconds to execute and require at least min_examined_row_limit  rows to be examined. The slow query log can be used to find queries that take a long time to execute and are therefore candidates for optimization. However, examining a long slow query log can be a time-consuming task. To make this easier, you can use the mysqldumpslow  command to process a slow query log file and summarize its contents. See Section 4.6.10, “mysqldumpslow — Summarize Slow Query Log Files” . 

The time to acquire the initial locks is not counted as execution time. mysqld  writes a statement to the slow query log after it has been executed and after all locks have been released, so log order might differ from execution order. 

## Slow Query Log Parameters 

•Slow Query Log Parameters 

•Slow Query Log Contents 

The minimum and default values of long_query_time  are 0 and 10, respectively. The value can be specified to a resolution of microseconds. 

By default, administrative statements are not logged, nor are queries that do not use indexes for lookups. This behavior can be changed using log_slow_admin_statements  and log_queries_not_using_indexes , as described later. 

By default, the slow query log is disabled. To specify the initial slow query log state explicitly, use --slow_query_log[={0|1}] . With no argument or an argument of 1, --slow_query_log enables the log. With an argument of 0, this option disables the log. To specify a log file name, use -- slow_query_log_file= file_name . To specify the log destination, use the log_output  system variable (as described in Section 5.4.1, “Selecting General Query Log and Slow Query Log Output Destinations” ). 

<img src='content_image/685366.jpg'>

## Note 

If you specify the TABLE  log destination, see Log Tables and “Too many open files” Errors. 

If you specify no name for the slow query log file, the default name is host_name -slow.log . The server creates the file in the data directory unless an absolute path name is given to specify a different directory. 

To disable or enable the slow query log or change the log file name at runtime, use the global slow_query_log  and slow_query_log_file  system variables. Set slow_query_log  to 0 to disable the log or to 1 to enable it. Set slow_query_log_file  to specify the name of the log file. If a log file already is open, it is closed and the new file is opened. 

The server writes less information to the slow query log if you use the --log-short-format  option. 

