This document focuses on currently supported variables.
Variables in Doris refer to variable settings in MySQL. However, some of the variables are only used to be compatible with some MySQL client protocols, and do not produce their actual meaning in the MySQL database.
All or specified variables can be viewed via SHOW VARIABLES [LIKE 'xxx'];. Such as:
SHOW VARIABLES; SHOW VARIABLES LIKE '%time_zone%';
Note that before version 1.1, after the setting takes effect globally, the setting value will be inherited in subsequent new session connections, but the value in the current session will remain unchanged. After version 1.1 (inclusive), after the setting takes effect globally, the setting value will be used in subsequent new session connections, and the value in the current session will also change.
For session-only, set by the SET var_name=xxx; statement. Such as:
SET exec_mem_limit = 137438953472; SET forward_to_master = true; SET time_zone = "Asia/Shanghai";
For global-level, set by SET GLOBAL var_name=xxx;. Such as:
SET GLOBAL exec_mem_limit = 137438953472
Note 1: Only ADMIN users can set variable at global-level.
Variables that support both session-level and global-level setting include:
time_zonewait_timeoutsql_modeenable_profilequery_timeoutinsert_timeoutexec_mem_limitbatch_sizeparallel_fragment_exec_instance_numparallel_exchange_instance_numallow_partition_column_nullableinsert_visible_timeout_msenable_fold_constant_by_beVariables that support only global-level setting include:
default_rowset_typedefault_password_lifetimepassword_historyvalidate_password_policyAt the same time, variable settings also support constant expressions. Such as:
SET exec_mem_limit = 10 * 1024 * 1024 * 1024;
SET forward_to_master = concat('tr', 'u', 'e');
In some scenarios, we may need to set variables specifically for certain queries. The SET_VAR hint sets the session value of a system variable temporarily (for the duration of a single statement). Examples:
SELECT /*+ SET_VAR(exec_mem_limit = 8589934592) */ name FROM people ORDER BY name; SELECT /*+ SET_VAR(query_timeout = 1, enable_partition_cache=true) */ sleep(3);
Note that the comment must start with /*+ and can only follow the SELECT.
Note:
The following content is automatically generated by
docs/generate-config-and-variable-doc.sh.To modify, please modify
fe/fe-core/src/main/java/org/apache/doris/qe/SessionVariable.javaandfe/fe-core/src/main/java/org/apache/ Description information in doris/qe/GlobalVariable.java.
<--DOC_PLACEHOLDER-->