Modifies dynamic system parameters at runtime without restarting the database.
Engines and versions
The ALTER SYSTEM statement applies to LindormTable and LindormTSDB.
This statement requires Lindorm SQL version 2.6.3.2 or later. To check your Lindorm SQL version, see SQL Version Guide.
Syntax
ALTER SYSTEM SET configuration_identifier = configuration_literalParameters
| Parameter | Description |
|---|---|
configuration_identifier | The name of the dynamic configuration parameter. Must be a valid SQL identifier. For supported parameters, see Supported configuration items. |
configuration_literal | The value of the dynamic configuration parameter. Must be a valid SQL constant. Accepted types: BIGINT, DOUBLE, BOOLEAN, or VARCHAR. |
Supported configuration items
LindormTable parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
FILE_FORMAT_VERSION | INTEGER | 2 | The version of LindormTable data files. Set to 5 to resolve the error Cell Tag is not supported since ldFileVersion is too small=2. |
SLOW_QUERY_RECORD_ENABLE | BOOLEAN | FALSE | Enables the slow query view. When enabled, queries that exceed the SLOW_QUERY_TIME_MS threshold are recorded in lindorm._slow_query_. Useful for O&M and troubleshooting. Valid values: TRUE, FALSE. |
SLOW_QUERY_TIME_MS | INTEGER | 10000 | The slow query threshold in milliseconds. Queries that run longer than this value might be recorded in lindorm_slow_query. After you update this value, queries sent to the Lindorm server might be recorded in the slow query view based on the new threshold. |
MAX_CONN | INTEGER | Varies | The maximum number of connections per node for LindormTable. Must be greater than 0. When the limit is reached, new connections are rejected with error 1040. Requires SQL engine version 2.7.0.0 or later. |
AUDIT_LEVEL | INTEGER | 0 | The audit log level. Valid values: 0 (DDL and DCL logs), 1 (DDL, DCL, and DML logs), 2 (DDL, DCL, and DQL logs), 3 (DDL, DCL, DML, and DQL logs). |
ERROR_LANG | VARCHAR | Region-dependent | The language for SQL error messages. Valid values: en (English), zh_CN (Simplified Chinese). The default depends on the region where the instance was created. Requires SQL engine version 2.9.0.0 or later. |
QUERY_MAX_MEM | BIGINT | 8388608 (8 MB) | The maximum memory a single query can use in the Lindorm SQL engine, in bytes. If a query hits this limit, increase the value incrementally. Setting this too high increases memory pressure on LindormTable and can affect system stability. Requires SQL engine version 2.9.6.0 or later. |
lindorm.allow.range.delete | BOOLEAN | FALSE | Enables batch delete. When enabled, large deletes may time out—use HINT to set a longer timeout. Large deletes also generate delete markers, which can affect query performance. Requires SQL engine version 2.9.1.0 or later. |
lindorm.indexed.non.primary.key.columns.max | INTEGER | 3 | The maximum number of non-primary key columns that can be used as index key columns. Setting this too high makes the index table row key longer, which can affect query performance. Requires SQL engine version 2.9.6.0 or later. |
lindorm.max.index.number | INTEGER | 5 | The maximum number of secondary indexes allowed. Too many secondary indexes can reduce write performance and increase disk usage. Requires SQL engine version 2.9.6.0 or later. |
lindorm.schema.column.nonpklength.max | INTEGER | 2097152 (2 MB) | The maximum data value that a single non-primary key column can store, in bytes. This is a table-level setting. Large values for big key-value reads and writes can cause garbage collection (GC) jitter. Requires SQL engine version 2.9.1.0 or later. |
SYSTEM_TIME_ZONE | STRING | UTC+8 | The default time zone for the database instance. |
Connection limits for MAX_CONN
The default maximum connections per node depends on the SQL engine version:
SQL engine version earlier than 2.7.0.0: 1000
SQL engine version 2.7.0.0 and later: 4000
Review your application's connection usage before increasing this limit.
LindormTSDB parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
USER_AUTH | BOOLEAN | FALSE | Enables user authentication and permission verification for LindormTSDB. When set to TRUE, all connections require a username and password, and LindormTSDB verifies permissions for each SQL statement. |
Before enabling USER_AUTH, plan carefully and fully assess the impact. After enabling, all connections must include user credentials—including the current connection that runs the ALTER SYSTEM statement. Some existing business access might fail after this feature is enabled.
Examples
Set the LindormTable file format version
Set the data file version to 5 to resolve the Cell Tag is not supported error:
ALTER SYSTEM SET FILE_FORMAT_VERSION = 5;Enable slow query recording
Enable the slow query view and set the recording threshold to 1 second (1000 ms):
-- Enable slow query recording
ALTER SYSTEM SET SLOW_QUERY_RECORD_ENABLE = TRUE;
-- Set the slow query threshold to 1 second (1000 ms)
ALTER SYSTEM SET SLOW_QUERY_TIME_MS = 1000;Set the maximum connections
Set the maximum connections per node to 5000:
ALTER SYSTEM SET MAX_CONN = 5000;Enable or disable LindormTSDB authentication
-- Enable authentication
ALTER SYSTEM SET USER_AUTH = TRUE;
-- Disable authentication
ALTER SYSTEM SET USER_AUTH = FALSE;Set the SQL error message language
Set the SQL error message language to Simplified Chinese:
ALTER SYSTEM SET ERROR_LANG = 'zh_CN';Enable batch delete
ALTER SYSTEM SET `lindorm.allow.range.delete` = TRUE;Set the maximum index key columns
Set the maximum number of non-primary key columns usable as index key columns to 5:
ALTER SYSTEM SET `lindorm.indexed.non.primary.key.columns.max` = 5;Set the maximum number of secondary indexes
Set the maximum number of secondary indexes to 5:
ALTER SYSTEM SET `lindorm.max.index.number` = 5;Set the maximum data size for a non-primary key column
Set the maximum data size for a single non-primary key column to 3,670,016 bytes (3.5 MB):
ALTER TABLE tableName SET 'MAX_NONPK_LEN' = '3670016';Verify the configuration
Use SHOW SYSTEM VARIABLES to confirm that a parameter was applied:
SHOW SYSTEM VARIABLES LIKE configuration_identifier;Replace configuration_identifier with the parameter name, for example:
SHOW SYSTEM VARIABLES LIKE 'SLOW_QUERY_TIME_MS';Parameters that have not been explicitly set using ALTER SYSTEM SET do not appear in SHOW SYSTEM VARIABLES output.