Ssl_client_connects * Ssl_connect_renegotiates * Ssl_ctx_verify_depth * Ssl_ctx_verify_mode * Ssl_finished_accepts * Ssl_finished_connects * Ssl_session_cache_hits * Ssl_session_cache_misses * Ssl_session_cache_overflows * Ssl_session_cache_size * Ssl_session_cache_timeouts * Ssl_sessions_reused * Ssl_used_session_cache_entries * Subquery_cache_hit * Subquery_cache_miss * Table_locks_immediate * Table_locks_waited * Tc_log_max_pages_used * Tc_log_page_waits * Transactions_gtid_foreign_engine * Transactions_multi_engine The different usage of FLUSH TABLES ----------------------------------- Purpose of FLUSH TABLES ----------------------- The purpose of FLUSH TABLES is to clean up the open table cache and table definition cache from not in use tables. This frees up memory and file descriptors. Normally this is not needed as the caches works on a FIFO bases, but can be useful if the server seams to use up to much memory for some reason. Purpose of FLUSH TABLES WITH READ LOCK -------------------------------------- FLUSH TABLES WITH READ LOCK is useful if you want to take a backup of some tables. When FLUSH TABLES WITH READ LOCK returns, all write access to tables are blocked and all tables are marked as 'properly closed' on disk. The tables can still be used for read operations. Purpose of FLUSH TABLES table_list ---------------------------------- FLUSH TABLES table_list is useful if you want to copy a table object/files to or from the server. This command puts a lock that stops new users of the table and will wait until everyone has stopped using the table. The table is then removed from the table definition and table cache. Note that it's up to the user to ensure that no one is accessing the table between FLUSH TABLES and the table is copied to or from the server. This can be secured by using LOCK TABLES. If there are any tables locked by the connection that is using FLUSH TABLES all the locked tables will be closed as part of the flush and reopened and relocked before FLUSH TABLES returns. This allows one to copy the table after FLUSH TABLES returns without having any writes on the table. For now this works works with most tables, except InnoDB as InnoDB may do background purges on the table even while it's write locked. Purpose of FLUSH TABLES table_list WITH READ LOCK ------------------------------------------------- FLUSH TABLES table_list WITH READ LOCK should work as FLUSH TABLES WITH READ LOCK, but only those tables that are listed will be properly closed. However in practice this works exactly like FLUSH TABLES WITH READ LOCK as the FLUSH command has anyway to wait for all WRITE operations to end because we are depending on a global read lock for this code. In the future we should consider fixing this to instead use meta data locks. Implementation of FLUSH TABLES commands from MariaDB 10.4.8 ----------------------------------------------------------- Implementation of FLUSH TABLES ------------------------------ * Free memory and file descriptors not in use Implementation of FLUSH TABLES WITH READ LOCK --------------------------------------------- * Lock all tables read only for simple old style backup. * All background writes are suspended and tables are marked as closed. * No statement requiring table changes are allowed for any user until UNLOCK TABLES. Instead of using FLUSH TABLE WITH READ LOCK one should in most cases instead use BACKUP STAGE BLOCK_COMMIT. Implementation of FLUSH TABLES table_list ----------------------------------------- * Free memory and file descriptors for tables not in use from table list. * Lock given tables as read only. * Wait until all translations has ended that uses any of the given tables. * Wait until all background writes are suspended and tables are marked as closed. Implementation of FLUSH TABLES table_list FOR EXPORT ---------------------------------------------------- * Free memory and file descriptors for tables not in use from table list * Lock given tables as read. * Wait until all background writes are suspended and tables are marked as closed. *™»N‰