This is a read-only copy of the MariaDB Knowledgebase generated on 2024-12-22. For the latest, interactive version please visit https://mariadb.com/kb/.

Information Schema SYSTEM_VARIABLES Table

The Information Schema SYSTEM_VARIABLES table shows current values and various metadata of all system variables.

It contains the following columns:

ColumnDescription
VARIABLE_NAMESystem variable name.
SESSION_VALUESession value of the variable or NULL if the variable only has a global scope.
GLOBAL_VALUEGlobal value of the variable or NULL if the variable only has a session scope.
GLOBAL_VALUE_ORIGINHow the global value was set — a compile-time default, auto-configured by the server, configuration file (or a command line), with the SQL statement.
DEFAULT_VALUECompile-time default value of the variable.
VARIABLE_SCOPEGlobal, session, or session-only.
VARIABLE_TYPEData type of the variable value.
VARIABLE_COMMENTHelp text, usually shown in mariadbd --help --verbose.
NUMERIC_MIN_VALUEFor numeric variables — minimal allowed value.
NUMERIC_MAX_VALUEFor numeric variables — maximal allowed value.
NUMERIC_BLOCK_SIZEFor numeric variables — a valid value must be a multiple of the "block size".
ENUM_VALUE_LISTFor ENUM, SET, and FLAGSET variables — the list of recognized values.
READ_ONLYWhether a variable can be set with the SQL statement. Note that many "read only" variables can still be set on the command line.
COMMAND_LINE_ARGUMENTWhether an argument is required when setting the variable on the command line. NULL when a variable can not be set on the command line.
GLOBAL_VALUE_PATHWhich config file the variable got its value from. NULL if not set in any config file. Added in MariaDB 10.5.0.

Example

SELECT * FROM information_schema.SYSTEM_VARIABLES 
  WHERE VARIABLE_NAME='JOIN_BUFFER_SIZE'\G
*************************** 1. row *****************************
        VARIABLE_NAME: JOIN_BUFFER_SIZE
        SESSION_VALUE: 131072
         GLOBAL_VALUE: 131072
  GLOBAL_VALUE_ORIGIN: COMPILE-TIME
        DEFAULT_VALUE: 131072
       VARIABLE_SCOPE: SESSION
        VARIABLE_TYPE: BIGINT UNSIGNED
     VARIABLE_COMMENT: The size of the buffer that is used for joins
    NUMERIC_MIN_VALUE: 128
    NUMERIC_MAX_VALUE: 18446744073709551615
   NUMERIC_BLOCK_SIZE: 128
      ENUM_VALUE_LIST: NULL
            READ_ONLY: NO
COMMAND_LINE_ARGUMENT: REQUIRED
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.