Use SHOW VARIABLES to inspect the current value of system attributes or table attributes. Run it after CREATE TABLE or ALTER TABLE to confirm that your changes took effect, or to check whether system-level settings such as slow query logging or authentication are active.
Prerequisites
Before you begin, make sure that:
The Lindorm SQL version is 2.6.3.2 or later. To check your version, see SQL versions
The engine version meets the minimum requirement for the features you want to use. See Applicable engines and versions
Applicable engines and versions
| Engine | Minimum version | Notes |
|---|---|---|
| LindormTable | 2.6.2 | TABLE scope requires LindormTable 2.6.3+ and Lindorm SQL 2.6.6+ |
| LindormTSDB | 3.4.35 | Only SYSTEM scope is supported |
To view or upgrade your engine version, see Release notes of LindormTable, Release notes of LindormTSDB, and Upgrade the minor engine version of a Lindorm instance.
Syntax
show_variables_statement ::= SHOW scope_expression VARIABLES
[ FROM table_identifier]
[ LIKE pattern_expression]
scop_expression ::= { SYSTEM | TABLE }Parameters
scope_expression
Specifies whether to display system attributes or table attributes.
| Value | LindormTable | LindormTSDB | Description |
|---|---|---|---|
SYSTEM | Supported | Supported | Returns all system attributes that have been modified |
TABLE | Supported (2.6.3+, Lindorm SQL 2.6.6+) | Not supported | Returns the attributes of the table specified in the FROM clause |
SYSTEM returns only attributes that have been explicitly set. If no system attributes have been modified, the result is empty.
FROM table_identifier
The FROM keyword is supported only when the scope_expression parameter is set to TABLE, and is not applicable to SYSTEM.
LIKE pattern_expression
Filters results by attribute name using a string pattern. Two wildcards are supported:
| Wildcard | Matches |
|---|---|
% | Zero or more characters |
_ | Exactly one character |
Returned results
SYSTEM scope: Returns system attributes that have been modified. If system attributes have not been modified, no results are returned. For the full list of configurable system attributes, see Supported configuration items.
TABLE scope: Returns table attributes that contain but are not limited to the attributes that can be configured in the
CREATE TABLEsyntax. For the full list of configurable table attributes, see Table options.
Examples
All examples use a two-column result set: Variable_name and Value.
Display all system attributes
SHOW SYSTEM VARIABLES;Result:
+--------------------------+-------+
| Variable_name | Value |
+--------------------------+-------+
| SLOW_QUERY_RECORD_ENABLE | true |
| FILE_FORMAT_VERSION | 5 |
+--------------------------+-------+The result shows only attributes that have been explicitly set. If no changes have been made to system attributes, the result is empty.
Display a specific table attribute
The following example uses a table created with this statement:
CREATE TABLE dt (p1 VARCHAR, c1 INTEGER, PRIMARY KEY(p1)) WITH (COMPRESSION = 'LZ4');To display the compression algorithm configured for the dt table:
SHOW TABLE VARIABLES FROM dt LIKE 'COMPRESSION';Result:
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| COMPRESSION | LZ4 |
+---------------+-------+Filter system attributes using wildcards
Use % to match a prefix and return all attributes whose names start with FILE:
SHOW SYSTEM VARIABLES LIKE 'FILE%';Result:
+---------------------+-------+
| Variable_name | Value |
+---------------------+-------+
| FILE_FORMAT_VERSION | 5 |
+---------------------+-------+Use an exact attribute name with LIKE to return a single attribute:
SHOW SYSTEM VARIABLES LIKE 'FILE_FORMAT_VERSION';Result:
+---------------------+-------+
| Variable_name | Value |
+---------------------+-------+
| FILE_FORMAT_VERSION | 5 |
+---------------------+-------+What's next
ALTER SYSTEM — modify system-level attributes
CREATE TABLE — configure table attributes at creation time
ALTER TABLE — modify table attributes after creation