Server Status Variables

Server status variables provide information about the global status of the server and the status of the current session in TiDB. Most of these variables are designed to be compatible with MySQL.

You can retrieve the global status using the SHOW GLOBAL STATUS command, and the status of the current session using the SHOW SESSION STATUS command.

Additionally, the FLUSH STATUS command is supported for MySQL compatibility.

Variable reference

Compression

  • Scope: SESSION
  • Type: Boolean
  • Indicates if the MySQL Protocol uses compression or not.

Compression_algorithm

  • Scope: SESSION
  • Type: String
  • Indicates the compression algorithm that is used for the MySQL Protocol.

Compression_level

  • Scope: SESSION
  • Type: Integer
  • The compression level that is used for the MySQL Protocol.

Ssl_cipher

  • Scope: SESSION | GLOBAL
  • Type: String
  • TLS Cipher that is in use.

Ssl_cipher_list

  • Scope: SESSION | GLOBAL
  • Type: String
  • The list of TLS Ciphers that the server supports.

Ssl_server_not_after

  • Scope: SESSION | GLOBAL
  • Type: Date
  • The expiration date of the X.509 certificate of the server that is used for TLS connections.

Ssl_server_not_before

  • Scope: SESSION | GLOBAL
  • Type: String
  • The start date of the X.509 certificate of the server that is used for TLS connections.

Ssl_verify_mode

  • Scope: SESSION | GLOBAL
  • Type: Integer
  • The TLS verification mode bitmask.

Ssl_version

  • Scope: SESSION | GLOBAL
  • Type: String
  • The version of the TLS protocol that is used

Uptime

  • Scope: SESSION | GLOBAL
  • Type: Integer
  • Uptime of the server in seconds.

ddl_schema_version

  • Scope: SESSION | GLOBAL
  • Type: Integer
  • The version of the DDL schema that is used.

last_plan_binding_update_time New in v5.2.0

  • Scope: SESSION
  • Type: Timestamp
  • The time and date of the last plan binding update.

server_id

  • Scope: SESSION | GLOBAL
  • Type: String
  • The UUID of the server.

tidb_gc_last_run_time

  • Scope: SESSION | GLOBAL
  • Type: String
  • The timestamp of the last run of GC.

tidb_gc_leader_desc

  • Scope: SESSION | GLOBAL
  • Type: String
  • Information about GC leader, including the hostname and process id (pid).

tidb_gc_leader_lease

  • Scope: SESSION | GLOBAL
  • Type: String
  • The timestamp of the GC lease.

tidb_gc_leader_uuid

  • Scope: SESSION | GLOBAL
  • Type: String
  • The UUID of the GC leader.

tidb_gc_safe_point

  • Scope: SESSION | GLOBAL
  • Type: String
  • The timestamp of the GC safe point.