SHOW VARIABLES
On this page
Shows a list of variable bindings.
Syntax
SHOW [CLUSTER] [LOCAL|GLOBAL] VARIABLES [EXTENDED]
[LIKE 'pattern' | WHERE expression]Arguments
-
pattern- Can contain the%wildcard which represents zero or more characters.Can also contain the _wildcard which represents one character. -
expression- A SQLWHEREclause. -
See the Permission Matrix for the required permission.
Remarks
-
CLUSTER- Displays the list of variables that can sync to all nodes._andSYNC CLUSTERare synonymous.Use either of the options in the command. -
LOCAL- Displays the list of variable bindings in the current connection to the node.This includes the values of global variables that have been set. Values of session variables that can be set globally are not included, when these variables are set globally. -
SESSIONandLOCALare synonymous.Use either of the options in the command. -
GLOBAL- Displays the list of global variable bindings.Values of session variables that can be set globally are also included, when these variables are set globally. -
If the
_option is specified,SYNC|CLUSTER GLOBALvariables are shown by default. -
If the
_option is not specified,SYNC|CLUSTER LOCALvariables are shown by default. -
EXTENDED- Displays additional information about the variables in the output.-
Cluster_- If the variable is global, has the same value astype Variable_.type If the variable is a session variable that can also be set globally, displays the type of sync variable. If the variable is not a sync variable, the value is Local. -
Variable_- Displays the type of sync variable.type For non-sync variables and session variables that can also be set globally, the value is Local.
-
-
This command can be run on any SingleStore node (see Node Requirements for SingleStore Commands).
Examples
Using SHOW VARIABLES with a Wildcard
SHOW VARIABLES LIKE 'auto%';
+--------------------------+-------+
| Variable_name | Value |
+--------------------------+-------+
| auto_attach | ON |
| auto_increment_increment | 1 |
| auto_increment_offset | 1 |
| auto_replicate | OFF |
| autocommit | ON |
+--------------------------+-------+Behavior of SHOW LOCAL VARIABLES When a Global Variable is Set
When a global variable is set, its value becomes effective in the current connection to the node.connect_ to 20, this value is shown in the SHOW LOCAL VARIABLES output:
SET GLOBAL connect_timeout = 20;SHOW LOCAL VARIABLES LIKE 'connect_timeout';
+-----------------+-------+
| Variable_name | Value |
+-----------------+-------+
| connect_timeout | 20 |
+-----------------+-------+Behavior of SHOW LOCAL VARIABLES When a Session Variable that can be Set Globally is Set
When a session variable that can also be set globally is set globally, its value is not effective in the current connection to the node.enable_ to OFF, the value is not shown in the SHOW LOCAL VARIABLES output:
SET GLOBAL enable_broadcast_left_join = OFF;SHOW LOCAL VARIABLES LIKE 'enable_broadcast_left_join';
+----------------------------+-------+
| Variable_name | Value |
+----------------------------+-------+
| enable_broadcast_left_join | ON |
+----------------------------+-------+Using the EXTENDED Clause
In this example, the value of Variable_ is Local because character_ is a session variable that can be set globally.Cluster_ is not Local because character_ is a sync variable.In_ column shows users with SYSTEM_ privilege which variables they are allowed to set.
SHOW VARIABLES EXTENDED LIKE 'character_set_server';
+----------------------+-------+---------------+----------------------------+---------------+
| Variable_name | Value | Variable_type | Cluster_type | In_Allow_List |
+----------------------+-------+---------------+----------------------------+---------------+
| character_set_server | utf8 | Local | Cluster-wide for all nodes | Yes |
+----------------------+-------+---------------+----------------------------+---------------+
SHOW VARIABLES EXTENDED LIKE 'memsql_version';
+----------------+-------+---------------+--------------+---------------+
| Variable_name | Value | Variable_type | Cluster_type | In_Allow_List |
+----------------+-------+---------------+--------------+---------------+
| memsql_version | 7.8.0 | Local | Local | No |
+----------------+-------+---------------+--------------+---------------+See Also
Last modified: January 11, 2023