Перейти к основному содержимому
Версия: 2.0.x

Системные переменные

Selena предоставляет множество системных переменных, которые можно устанавливать и изменять в соответствии с вашими требованиями. Этот раздел описывает переменные, поддерживаемые Selena. Вы можете просмотреть настройки этих переменных, выполнив команду SHOW VARIABLES на вашем MySQL client. Вы также можете использовать команду SET для динамической установки или изменения переменных. Вы можете сделать эти переменные действующими глобально на всей системе, только в текущей сессии или только в одном запросе.

Переменные в Selena относятся к наборам переменных в MySQL, но некоторые переменные совместимы только с протоколом MySQL client и не функционируют в базе данных MySQL.

ПРИМЕЧАНИЕ

Любой пользователь имеет привилегию выполнять SHOW VARIABLES и делать переменную действующей на уровне сессии. Однако только пользователи с привилегией OPERATE уровня SYSTEM могут делать переменную действующей глобально. Глобально действующие переменные вступают в силу для всех будущих сессий (исключая текущую сессию).

Если вы хотите внести изменение настройки для текущей сессии, а также применить это изменение ко всем будущим сессиям, вы можете внести изменение дважды, один раз без модификатора GLOBAL и один раз с ним. Например:

SET query_mem_limit = 137438953472; -- Применить к текущей сессии.
SET GLOBAL query_mem_limit = 137438953472; -- Применить ко всем будущим сессиям.

Иерархия и типы переменных

Selena поддерживает три типа (уровня) переменных: глобальные переменные, переменные сессии и хинты SET_VAR. Их иерархическая связь следующая:

  • Глобальные переменные действуют на глобальном уровне и могут быть переопределены переменными сессии и хинтами SET_VAR.
  • Переменные сессии действуют только на текущую сессию и могут быть переопределены хинтами SET_VAR.
  • Хинты SET_VAR действуют только на текущий запрос.

Просмотр переменных

Вы можете просмотреть все или некоторые переменные, используя SHOW VARIABLES [LIKE 'xxx']. Пример:

-- Показать все переменные в системе.
SHOW VARIABLES;

-- Показать переменные, соответствующие определённому шаблону.
SHOW VARIABLES LIKE '%time_zone%';

Установка переменных

Установка переменных глобально или для одной сессии

Вы можете установить переменные так, чтобы они действовали глобально или только на текущую сессию. При установке глобально новое значение будет использоваться для всех будущих сессий, в то время как текущая сессия по-прежнему использует исходное значение. При установке "только для текущей сессии" переменная будет действовать только на текущую сессию.

Переменная, установленная с помощью SET <var_name> = xxx;, действует только для текущей сессии. Пример:

SET query_mem_limit = 137438953472;

SET forward_to_master = true;

SET time_zone = "Asia/Shanghai";

Переменная, установленная с помощью SET GLOBAL <var_name> = xxx;, действует глобально. Пример:

SET GLOBAL query_mem_limit = 137438953472;

Следующие переменные действуют только глобально. Они не могут действовать для одной сессии, что означает, что вы должны использовать SET GLOBAL <var_name> = xxx; для этих переменных. Если вы попытаетесь установить такую переменную для одной сессии (SET <var_name> = xxx;), будет возвращена ошибка.

  • activate_all_roles_on_login
  • character_set_database
  • default_rowset_type
  • enable_query_queue_select
  • enable_query_queue_statistic
  • enable_query_queue_load
  • init_connect
  • lower_case_table_names
  • license
  • language
  • query_cache_size
  • query_queue_fresh_resource_usage_interval_ms
  • query_queue_concurrency_limit
  • query_queue_mem_used_pct_limit
  • query_queue_cpu_used_permille_limit
  • query_queue_pending_timeout_second
  • query_queue_max_queued_queries
  • system_time_zone
  • version_comment
  • version

Кроме того, настройки переменных также поддерживают константные выражения, такие как:

SET query_mem_limit = 10 * 1024 * 1024 * 1024;
SET forward_to_master = concat('tr', 'u', 'e');

Установка переменных в одном запросе

В некоторых сценариях вам может потребоваться установить переменные специально для определённых запросов. Используя хинт SET_VAR, вы можете установить переменные сессии, которые будут действовать только в рамках одного оператора.

Selena поддерживает использование SET_VAR в следующих операторах:

  • SELECT
  • INSERT (начиная с v1.5.2)
  • UPDATE (начиная с v1.5.2)
  • DELETE (начиная с v1.5.2)

SET_VAR может быть размещён только после указанных выше ключевых слов и заключён в /*+...*/.

Пример:

SELECT /*+ SET_VAR(query_mem_limit = 8589934592) */ name FROM people ORDER BY name;

SELECT /*+ SET_VAR(query_timeout = 1) */ sleep(3);

UPDATE /*+ SET_VAR(insert_timeout=100) */ tbl SET c1 = 2 WHERE c1 = 1;

DELETE /*+ SET_VAR(query_mem_limit = 8589934592) */
FROM my_table PARTITION p1
WHERE k1 = 3;

INSERT /*+ SET_VAR(insert_timeout = 10000000) */
INTO insert_wiki_edit
SELECT * FROM FILES(
"path" = "s3://inserttest/parquet/insert_wiki_edit_append.parquet",
"format" = "parquet",
"aws.s3.access_key" = "XXXXXXXXXX",
"aws.s3.secret_key" = "YYYYYYYYYY",
"aws.s3.region" = "us-west-2"
);

Вы также можете установить несколько переменных в одном операторе. Пример:

SELECT /*+ SET_VAR
(
exec_mem_limit = 515396075520,
query_timeout=10000000,
batch_size=4096,
parallel_fragment_exec_instance_num=32
)
*/ * FROM TABLE;

Установка переменных как свойств пользователя

Вы можете установить переменные сессии как свойства пользователя, используя ALTER USER. Эта функция поддерживается начиная с v1.5.2.

Пример:

-- Установить переменную сессии `query_timeout` в `600` для пользователя jack.
ALTER USER 'jack' SET PROPERTIES ('session.query_timeout' = '600');

Описание переменных

Переменные описаны в алфавитном порядке. Переменные с меткой global могут действовать только глобально. Другие переменные могут действовать либо глобально, либо для одной сессии.

activate_all_roles_on_login (global)

  • Описание: Включить ли все roles (включая roles по умолчанию и предоставленные roles) для пользователя Selena, когда пользователь подключается к cluster Selena.
    • Если включено (true), все roles пользователя активируются при входе пользователя. Это имеет приоритет над roles, установленными SET DEFAULT ROLE.
    • Если отключено (false), активируются roles, установленные SET DEFAULT ROLE.
  • По умолчанию: false
  • Представлено в: v1.5.2

Если вы хотите активировать roles, назначенные вам в сессии, используйте команду SET ROLE.

auto_increment_increment

Используется для совместимости с MySQL client. Не имеет практического применения.

autocommit

Используется для совместимости с MySQL client. Не имеет практического применения.

chunk_size

  • Описание: Используется для указания количества строк одного пакета, передаваемого каждым узлом во время выполнения запроса. По умолчанию 4096, т.е. каждые 4096 строк данных, сгенерированных исходным узлом, упаковываются и отправляются на узел назначения. Большее количество строк улучшит пропускную способность запроса в сценариях с большим объёмом данных, но может увеличить задержку запроса в сценариях с малым объёмом данных. Также это может увеличить затраты памяти на запрос. Мы рекомендуем устанавливать batch_size между 1024 и 4096.
  • По умолчанию: 4096

big_query_profile_threshold

  • Описание: Используется для установки порога для больших запросов. Когда переменная сессии enable_profile установлена в false и количество времени, затраченное на запрос, превышает порог, указанный переменной big_query_profile_threshold, для этого запроса генерируется profile.

    Примечание: Мы ввели big_query_profile_second_threshold для установки порога для больших запросов. В v1.5.2 и последующих релизах этот параметр был заменён на big_query_profile_threshold для более гибких опций конфигурации.

  • По умолчанию: 0

  • Единица измерения: Секунда

  • Тип данных: String

  • Представлено в: v1.5.2

catalog

  • Описание: Используется для указания catalog, к которому принадлежит сессия.
  • По умолчанию: default_catalog
  • Тип данных: String
  • Представлено в: v1.5.2

cbo_decimal_cast_string_strict

  • Описание: Контролирует, как CBO преобразует данные из типа DECIMAL в тип STRING. Если эта переменная установлена в true, преобладает логика, встроенная в v1.5.2.x и более поздних версиях, и система выполняет строгое преобразование (а именно, система усекает сгенерированную строку и заполняет нулями на основе длины шкалы). Если эта переменная установлена в false, преобладает логика, встроенная в версиях ранее v1.5.2.x, и система обрабатывает все действительные цифры для генерации строки.
  • По умолчанию: true
  • Представлено в: v1.5.2

cbo_enable_low_cardinality_optimize

  • Описание: Whether to enable low cardinality optimization. After this feature is enabled, the performance of querying STRING columns improves by about three times.
  • По умолчанию: true

cbo_eq_base_type

  • Описание: Specifies the data type used for data comparison between DECIMAL data and STRING data. The default value is DECIMAL, and VARCHAR is also a valid value. This variable takes effect only for = and != comparison.
  • Тип данных: String
  • Представлено в: v1.5.2

cbo_json_v2_dict_opt

  • Описание: Whether to enable low-cardinality dictionary optimization for Flat JSON (JSON v2) extended string subcolumns created by JSON path rewrite. When enabled, the optimizer may build and use global dictionaries for those subcolumns to accelerate string expressions, GROUP BY, and JOIN operations.
  • По умолчанию: true
  • Тип данных: Boolean

cbo_json_v2_rewrite

  • Описание: Whether to enable JSON v2 path rewrite in the optimizer. When enabled, JSON functions (such as get_json_*) can be rewritten to direct access of Flat JSON subcolumns, enabling predicate pushdown, column pruning, and dictionary optimization.
  • По умолчанию: true
  • Тип данных: Boolean
  • Описание: Specifies the maximum number of candidate materialized views allowed during query planning.
  • По умолчанию: 64
  • Представлено в: v1.5.2

cbo_prune_subfield

  • Описание: Whether to enable JSON subfield pruning. This variable must be used with the BE dynamic parameter enable_json_flat. Otherwise, it may degrade JSON data query performance.
  • По умолчанию: false
  • Тип данных: Int
  • Представлено в: v1.5.2

custom_query_id (session)

  • Описание: Used to bind some external identifier to a current query. Can be set using SET SESSION custom_query_id = 'my-query-id'; before executing a query. The value is reset after query is finished. This value can be passed to KILL QUERY 'my-query-id'. Value can be found in audit logs as a customQueryId field.
  • По умолчанию: ""
  • Тип данных: String
  • Представлено в: v1.5.2

enable_sync_materialized_view_rewrite

  • Описание: Whether to enable query rewrite based on synchronous materialized views.
  • По умолчанию: true
  • Представлено в: v1.5.2

query_including_mv_names

  • Описание: Specifies the name of the asynchronous materialized views to include in query execution. You can use this variable to limit the number of candidate materialized views and improve the query rewrite performance in the optimizer. This item takes effect prior to query_excluding_mv_names.
  • По умолчанию: empty
  • Тип данных: String
  • Представлено в: v1.5.2

query_excluding_mv_names

  • Описание: Specifies the name of the asynchronous materialized views to exclude from query execution. You can use this variable to limit the number of candidate materialized views and reduce the time of query rewrite in the optimizer. query_including_mv_names takes effect prior to this item.
  • По умолчанию: empty
  • Тип данных: String
  • Представлено в: v1.5.2

optimizer_materialized_view_timelimit

  • Описание: Specifies the maximum time that one materialized view rewrite rule can consume. When the threshold is reached, this rule will not be used for query rewrite.
  • По умолчанию: 1000
  • Единица измерения: ms
  • Представлено в: v1.5.2

enable_materialized_view_agg_pushdown_rewrite

  • Описание: Whether to enable aggregation pushdown for materialized view query rewrite. If it is set to true, aggregate functions will be pushed down to Scan Operator during query execution and rewritten by the materialized view before the Join Operator is executed. This will relieve the data expansion caused by Join and thereby improve the query performance. For detailed information about the scenarios and limitations of this feature, see Aggregation pushdown.
  • По умолчанию: false
  • Представлено в: v1.5.2

enable_materialized_view_text_match_rewrite

  • Описание: Whether to enable text-based materialized view rewrite. When this item is set to true, the optimizer will compare the query with the existing materialized views. A query will be rewritten if the abstract syntax tree of the materialized view's definition matches that of the query or its sub-query.
  • По умолчанию: true
  • Представлено в: v1.5.2

materialized_view_subuqery_text_match_max_count

  • Описание: Specifies the maximum number of times that the system checks whether a query's sub-query matches the materialized views' definition.
  • По умолчанию: 4
  • Представлено в: v1.5.2

enable_force_rule_based_mv_rewrite

  • Описание: Whether to enable query rewrite for queries against multiple tables in the optimizer's rule-based optimization phase. Enabling this feature will improve the robustness of the query rewrite. However, it will also increase the time consumption if the query misses the materialized view.
  • По умолчанию: true
  • Представлено в: v1.5.2

enable_view_based_mv_rewrite

  • Описание: Whether to enable query rewrite for logical view-based materialized views. If this item is set to true, the logical view is used as a unified node to rewrite the queries against itself for better performance. If this item is set to false, the system transcribes the queries against logical views into queries against physical tables or materialized views and then rewrites them.
  • По умолчанию: false
  • Представлено в: v1.5.2

enable_materialized_view_union_rewrite

  • Описание: Whether to enable materialized view union rewrite. If this item is set to true, the system seeks to compensate the predicates using UNION ALL when the predicates in the materialized view cannot satisfy the query's predicates.
  • По умолчанию: true
  • Представлено в: v1.5.2

enable_materialized_view_plan_cache

  • Описание: Whether to enable materialized view plan cache, which can optimize the automatic rewrite performance of materialized views. Setting it to true indicates enabling it.
  • По умолчанию: true
  • Представлено в: v1.5.2

enable_cbo_based_mv_rewrite

  • Описание: Whether to enable materialized view rewrite in CBO phase which can maximize the likelihood of successful query rewriting (e.g., when the join order differs between materialized views and queries), but it will increase the execution time of the optimizer phase.
  • По умолчанию: true
  • Представлено в: v1.5.2, v2.0.0

enable_parquet_reader_bloom_filter

  • Описание: Whether to enable the bloom filter of Parquet file to improve performance. true indicates enabling the bloom filter, and false indicates disabling it. You can also control this behavior on system level using the BE configuration parquet_reader_bloom_filter_enable. Bloom filters in Parquet are maintained at the column level within each row group. If a Parquet file contains bloom filters for certain columns, queries can use predicates on those columns to efficiently skip row groups.
  • По умолчанию: true
  • Представлено в: v1.5.2

enable_plan_advisor

  • Описание: Whether to enable Query Feedback feature for slow queries and manually marked queries.
  • По умолчанию: true
  • Представлено в: v1.5.2

enable_plan_analyzer

  • Описание: Whether to enable Query Feedback feature for all queries. This variable takes effect only when enable_plan_advisor is set to true.
  • По умолчанию: false
  • Представлено в: v1.5.2

enable_parquet_reader_bloom_filter

  • По умолчанию: true
  • Тип: Boolean
  • Единица измерения: -
  • Описание: Whether to enable Bloom Filter optimization when reading Parquet files.
    • true (Default): Enable Bloom Filter optimization when reading Parquet files.
    • false: Disable Bloom Filter optimization when reading Parquet files.
  • Представлено в: v1.5.2

enable_parquet_reader_page_index

  • По умолчанию: true
  • Тип: Boolean
  • Единица измерения: -
  • Описание: Whether to enable Page Index optimization when reading Parquet files.
    • true (Default): Enable Page Index optimization when reading Parquet files.
    • false: Disable Page Index optimization when reading Parquet files.
  • Представлено в: v1.5.2

follower_query_forward_mode

  • Описание: Specifies to which FE nodes the query statements are routed.

    • Valid values:

      • default: Routes the query statement to the Leader FE or Follower FEs, depending on the Follower's replay progress. If the Follower FE nodes have not completed replay progress, queries will be routed to the Leader FE node. If the replay progress is complete, queries will be preferentially routed to the Follower FE node.
      • leader: Routes the query statement to the Leader FE.
      • follower: Routes the query statement to Follower FE.
  • По умолчанию: default

  • Тип данных: String

  • Представлено в: v1.5.2

character_set_database (global)

  • Тип данных: StringThe character set supported by Selena. Only UTF8 (utf8) is supported.
  • По умолчанию: utf8
  • Тип данных: String

connector_io_tasks_per_scan_operator

  • Описание: The maximum number of concurrent I/O tasks that can be issued by a scan operator during external table queries. The value is an integer. Currently, Selena can adaptively adjust the number of concurrent I/O tasks when querying external tables. This feature is controlled by the variable enable_connector_adaptive_io_tasks, which is enabled by default.
  • По умолчанию: 16
  • Тип данных: Int
  • Представлено в: v1.5.2

connector_sink_compression_codec

  • Описание: Specifies the compression algorithm used for writing data into Hive tables or Iceberg tables, or exporting data with Files(). This parameter only takes effect in the following situations:
    • The compression_codec property does not exist in the Hive tables.
    • The write.parquet.compression-codec properties do not exist in the Iceberg tables.
    • The compression property is not set for INSERT INTO FILES.
  • Допустимые значения: uncompressed, snappy, lz4, zstd, and gzip.
  • По умолчанию: uncompressed
  • Тип данных: String
  • Представлено в: v1.5.2

connector_sink_target_max_file_size

  • Описание: Specifies the maximum size of target file for writing data into Hive tables or Iceberg tables, or exporting data with Files(). The limit is not exact and is applied on a best-effort basis.
  • Единица измерения: Bytes
  • По умолчанию: 1073741824
  • Тип данных: Long
  • Представлено в: v1.5.2

count_distinct_column_buckets

  • Описание: The number of buckets for the COUNT DISTINCT column in a group-by-count-distinct query. This variable takes effect only when enable_distinct_column_bucketization is set to true.
  • По умолчанию: 1024
  • Представлено в: v1.5.2

default_rowset_type (global)

Used to set the default storage format used by the storage engine of the computing node. The currently supported storage formats are alpha and beta.

default_table_compression

  • Описание: The default compression algorithm for table storage. Supported compression algorithms are snappy, lz4, zlib, zstd.

    Note that if you specified the compression property in a CREATE TABLE statement, the compression algorithm specified by compression takes effect.

  • По умолчанию: lz4_frame

  • Представлено в: v1.5.2

disable_colocate_join

  • Описание: Used to control whether the Colocation Join is enabled. The default value is false, meaning the feature is enabled. When this feature is disabled, query planning will not attempt to execute Colocation Join.
  • По умолчанию: false

disable_streaming_preaggregations

Used to enable the streaming pre-aggregations. The default value is false, meaning it is enabled.

div_precision_increment

Используется для совместимости с MySQL client. Не имеет практического применения.

dynamic_overwrite

  • Описание: Whether to enable the Dynamic Overwrite semantic for INSERT OVERWRITE with partitioned tables. Valid values:
    • true: Enables Dynamic Overwrite.
    • false: Disables Dynamic Overwrite and uses the default semantic.
  • По умолчанию: false
  • Представлено в: v1.5.2

enable_datacache_async_populate_mode

  • Описание: Whether to populate the data cache in asynchronous mode. By default, the system uses the synchronous mode to populate data cache, that is, populating the cache while querying data.
  • По умолчанию: false
  • Представлено в: v1.5.2

enable_connector_adaptive_io_tasks

  • Описание: Whether to adaptively adjust the number of concurrent I/O tasks when querying external tables. Default value is true. If this feature is not enabled, you can manually set the number of concurrent I/O tasks using the variable connector_io_tasks_per_scan_operator.
  • По умолчанию: true
  • Представлено в: v1.5.2

enable_distinct_column_bucketization

  • Описание: Whether to enable bucketization for the COUNT DISTINCT colum in a group-by-count-distinct query. Use the select a, count(distinct b) from t group by a; query as an example. If the GROUP BY colum a is a low-cardinality column and the COUNT DISTINCT column b is a high-cardinality column which has severe data skew, performance bottleneck will occur. In this situation, you can split data in the COUNT DISTINCT column into multiple buckets to balance data and prevent data skew. You must use this variable with the variable count_distinct_column_buckets.

    You can also enable bucketization for the COUNT DISTINCT column by adding the skew hint to your query, for example, select a,count(distinct [skew] b) from t group by a;.

  • По умолчанию: false, which means this feature is disabled.

  • Представлено в: v1.5.2

enable_group_by_compressed_key

  • Описание: Whether to use accurate statistical information to compress the GROUP BY Key column. Valid values: true and false.
  • По умолчанию: true
  • Представлено в: v2.0.0

enable_gin_filter

  • Описание: Whether to utilize the fulltext inverted index during queries.
  • По умолчанию: true
  • Представлено в: v1.5.2

enable_group_execution

  • Описание: Whether to enable Colocate Group Execution. Colocate Group Execution is an execution pattern that leverages physical data partitioning, where a fixed number of threads sequentially process their respective data ranges to enhance locality and throughput. Enabling this feature can reduce memory usage.
  • По умолчанию: true
  • Представлено в: v1.5.2

enable_group_level_query_queue (global)

  • Описание: Whether to enable resource group-level query queue.
  • По умолчанию: false, which means this feature is disabled.
  • Представлено в: v1.5.2

enable_insert_partial_update

  • Описание: Whether to enable Partial Update for INSERT statements on Primary Key tables. When this item is set to true (default), if an INSERT statement specifies only a subset of columns (fewer than the number of all non-generated columns in the table), the system performs a Partial Update to update only the specified columns while preserving existing values in other columns. When set to false, the system uses default values for unspecified columns instead of preserving existing values. This feature is particularly useful for updating specific columns in Primary Key tables without affecting other column values.
  • По умолчанию: true
  • Представлено в: v1.5.2, v2.0.0

enable_iceberg_metadata_cache

  • Описание: Whether to cache pointers and partition names for Iceberg tables. From v1.5.2 to v1.5.2, this parameter is set to true by default, regardless of what metastore service is used. In v1.5.2 and later, if the Iceberg cluster uses AWS Glue as metastore, this parameter still defaults to true. However, if the Iceberg cluster uses other metastore service such as Hive metastore, this parameter defaults to false.
  • Представлено в: v1.5.2

max_unknown_string_meta_length (global)

  • Описание: Fallback length for string columns in query result metadata when the max length is unknown. Clients that rely on the metadata may return empty values or truncation if the reported length is smaller than actual values. Valid range is 1 to 1048576.
  • По умолчанию: 64
  • Data Type: int
  • Представлено в: v1.5.2

enable_metadata_profile

  • Описание: Whether to enabled Profile for Iceberg Catalog metadata.
  • По умолчанию: true
  • Представлено в: v1.5.2

plan_mode

  • Описание: The metadata retrieval strategy of Iceberg Catalog. For more information, see Iceberg Catalog metadata retrieval strategy. Valid values:
    • auto: The system will automatically select the retrieval plan.
    • local: Use the local cache plan.
    • distributed: Use the distributed plan.
  • По умолчанию: auto
  • Представлено в: v1.5.2

enable_iceberg_column_statistics

  • Описание: Whether to obtain column statistics, such as min, max, null count, row size, and ndv (if a puffin file exists). When this item is set to false, only the row count information will be collected.
  • По умолчанию: false
  • Представлено в: v1.5.2

enable_parallel_merge

  • Описание: Whether to enable parallel merge for sorting. When this feature is enabled, the merge phase of sorting will utilize multiple threads for merge operations.
  • По умолчанию: true
  • Представлено в: v1.5.2

enable_per_bucket_optimize

  • Описание: Whether to enable bucketed computation. When this feature is enabled, stage-one aggregation can be computed in bucketed order, reducing memory usage.
  • По умолчанию: true
  • Представлено в: v1.5.2

metadata_collect_query_timeout

  • Описание: The timeout duration for Iceberg Catalog metadata collection queries.
  • Единица измерения: Second
  • По умолчанию: 60
  • Представлено в: v1.5.2

enable_insert_strict

  • Описание: Whether to enable strict mode while loading data using INSERT from files(). Valid values: true and false (Default). When strict mode is enabled, the system loads only qualified rows. It filters out unqualified rows and returns details about the unqualified rows. For more information, see Strict mode. In versions earlier than v1.5.2, when enable_insert_strict is set to true, the INSERT jobs fails when there is an unqualified rows.
  • По умолчанию: true

insert_max_filter_ratio

  • Описание: The maximum error tolerance of INSERT from files(). It's the maximum ratio of data records that can be filtered out due to inadequate data quality. When the ratio of unqualified data records reaches this threshold, the job fails. Range: [0, 1].
  • По умолчанию: 0
  • Представлено в: v1.5.2

insert_timeout

  • Описание: The timeout duration of the INSERT job. Unit: Seconds. From v1.5.2 onwards, insert_timeout applies to operations involved INSERT (for example, UPDATE, DELETE, CTAS, materialized view refresh, statistics collection, and PIPE), replacing query_timeout.
  • По умолчанию: 14400
  • Представлено в: v1.5.2

enable_materialized_view_for_insert

  • Описание: Whether to allow Selena to rewrite queries in INSERT INTO SELECT statements.
  • По умолчанию: false, which means Query Rewrite in such scenarios is disabled by default.
  • Представлено в: v1.5.2

enable_rule_based_materialized_view_rewrite

  • Описание: Controls whether to enable rule-based materialized view query rewrite. This variable is mainly used in single-table query rewrite. * По умолчанию: true
  • Тип данных: Boolean
  • Представлено в: v1.5.2

enable_short_circuit

  • Описание: Whether to enable short circuiting for queries. Default: false. If it is set to true, when the query meets the criteria (to evaluate whether the query is a point query): the conditional columns in the WHERE clause include all primary key columns, and the operators in the WHERE clause are = or IN, the query takes the short circuit.
  • По умолчанию: false
  • Представлено в: v1.5.2

enable_spm_rewrite

  • Описание: Whether to enable SQL Plan Manager (SPM) query rewrite. When enabled, Selena automatically rewrites queries to use bound query plans, improving query performance and stability.
  • По умолчанию: false

enable_spill

  • Описание: Whether to enable intermediate result spilling. Default: false. If it is set to true, Selena spills the intermediate results to disk to reduce the memory usage when processing aggregate, sort, or join operators in queries.
  • По умолчанию: false
  • Представлено в: v1.5.2

enable_spill_to_remote_storage

  • Описание: Whether to enable intermediate result spilling to object storage. If it is set to true, Selena spills the intermediate results to the storage volume specified in spill_storage_volume after the capacity limit of the local disk is reached. For more information, see Spill to object storage.
  • По умолчанию: false
  • Представлено в: v1.5.2

enable_strict_order_by

  • Описание: Used to check whether the column name referenced in ORDER BY is ambiguous. When this variable is set to the default value TRUE, an error is reported for such a query pattern: Duplicate alias is used in different expressions of the query and this alias is also a sorting field in ORDER BY, for example, select distinct t1.* from tbl1 t1 order by t1.k1;. The logic is the same as that in v1.5.2 and earlier. When this variable is set to FALSE, a loose deduplication mechanism is used, which processes such queries as valid SQL queries.
  • По умолчанию: true
  • Представлено в: v1.5.2

enable_profile

  • Описание: Specifies whether to send the profile of a query for analysis. The default value is false, which means no profile is required.

    By default, a profile is sent to the FE only when a query error occurs in the BE. Profile sending causes network overhead and therefore affects high concurrency.

    If you need to analyze the profile of a query, you can set this variable to true. After the query is completed, the profile can be viewed on the web page of the currently connected FE (address: fe_host:fe_http_port/query). This page displays the profiles of the latest 100 queries with enable_profile turned on.

  • По умолчанию: false

enable_query_queue_load (global)

  • Описание: Boolean value to enable query queues for loading tasks.
  • По умолчанию: false

enable_query_queue_select (global)

  • Описание: Whether to enable query queues for SELECT queries.
  • По умолчанию: false

enable_query_queue_statistic (global)

  • Описание: Whether to enable query queues for statistics queries.
  • По умолчанию: false

enable_query_tablet_affinity

  • Описание: Boolean value to control whether to direct multiple queries against the same tablet to a fixed replica.

    In scenarios where the table to query has a large number of tablets, this feature significantly improves query performance because the meta information and data of the tablet can be cached in memory more quickly.

    However, if there are some hotspot tablets, this feature may degrade the query performance because it directs the queries to the same BE, making it unable to fully use the resources of multiple BEs in high concurrency scenarios.

  • По умолчанию: false, which means the system selects a replica for each query.

  • Представлено в: v1.5.2.

enable_lake_tablet_internal_parallel

  • Описание: Whether to enable Parallel Scan for Cloud-native tables in a shared-data cluster.
  • По умолчанию: true
  • Тип данных: Boolean
  • Представлено в: v1.5.2

tablet_internal_parallel_mode

  • Описание: Internal Parallel Scan strategy of tablets. Valid Values:
    • auto: When the number of Tablets to be scanned on BE or CN nodes is less than the Degree of Parallelism (DOP), the system automatically determines whether Parallel Scan is needed based on the estimated size of the Tablets.
    • force_split: Forces the splitting of Tablets and performs Parallel Scan.
  • По умолчанию: auto
  • Тип данных: String
  • Представлено в: v1.5.2

enable_scan_datacache

  • Описание: Specifies whether to enable the Data Cache feature. After this feature is enabled, Selena caches hot data read from external storage systems into blocks, which accelerates queries and analysis. For more information, see Data Cache. In versions prior to 3.2, this variable was named as enable_scan_block_cache.
  • По умолчанию: true
  • Представлено в: v1.5.2

populate_datacache_mode

  • Описание: Specifies the population behavior of Data Cache when reading data blocks from external storage systems. Valid values:
    • auto (default): the system automatically caches data selectively based on the population rule.
    • always: Always cache the data.
    • never: Never cache the data.
  • По умолчанию: auto
  • Представлено в: v1.5.2

enable_datacache_io_adaptor

  • Описание: Whether to enable the Data Cache I/O Adaptor. Setting this to true enables the feature. When this feature is enabled, the system automatically routes some cache requests to remote storage when the disk I/O load is high, reducing disk pressure.
  • По умолчанию: true
  • Представлено в: v1.5.2

enable_file_metacache

  • Описание: Whether to enable metadata cache for files in remote storage (Footer Cache). Setting this to true enables the feature. Footer Cache directly caches the parsed Footer object in memory. When the same file's Footer is accessed in subsequent queries, the object descriptor can be obtained directly from the cache, avoiding repetitive parsing. This feature uses the memory module of the Data Cache for data caching. Therefore, you must ensure that the BE parameter datacache_enable is set to true and configure a reasonable value for datacache_mem_size.
  • По умолчанию: true
  • Представлено в: v1.5.2

enable_file_pagecache

  • Описание: Whether to enable Page Cache for files in remote storage. Setting this to true enables the feature. Page Cache stores decompressed Parquet page data in memory. When the same page is accessed in subsequent queries, the data can be obtained directly from the cache, avoiding repetitive I/O operations and decompression. This feature works together with the Data Cache and uses the same memory module. When enabled, Page Caache can significantly improve query performance for workloads with repetitive page access patterns.
  • По умолчанию: true
  • Представлено в: v2.0.0

enable_datacache_sharing

  • Описание: Whether to enable Cache Sharing. Setting this to true enables the feature. Cache Sharing is used to support accessing cache data from other nodes through the network, which can help to reduce performance jitter caused by cache invalidation during cluster scaling. This variable takes effect only when the FE parameter enable_trace_historical_node is set to true.
  • По умолчанию: true
  • Представлено в: v1.5.2

datacache_sharing_work_period

  • Описание: The period of time that Cache Sharing takes effect. After each cluster scaling operation, only the requests within this period of time will try to access the cache data from other nodes if the Cache Sharing feature is enabled.
  • По умолчанию: 600
  • Единица измерения: Seconds
  • Представлено в: v1.5.2

historical_nodes_min_update_interval

  • Описание: The minimum interval between two updates of historical node records. If the nodes of a cluster change frequently in a short period of time (that is, less than the value set in this variable), some intermediate states will not be recorded as valid historical node snapshots. The historical nodes are the main basis for the Cache Sharing feature to choose the right cache nodes during cluster scaling.
  • По умолчанию: 600
  • Единица измерения: Seconds
  • Представлено в: v1.5.2

enable_tablet_internal_parallel

  • Описание: Whether to enable adaptive parallel scanning of tablets. After this feature is enabled, multiple threads can be used to scan one tablet by segment, increasing the scan concurrency.
  • По умолчанию: true
  • Представлено в: v1.5.2

enable_query_cache

  • Описание: Specifies whether to enable the Query Cache feature. Valid values: true and false. true specifies to enable this feature, and false specifies to disable this feature. When this feature is enabled, it works only for queries that meet the conditions specified in the application scenarios of Query Cache.
  • По умолчанию: false
  • Представлено в: v1.5.2

enable_adaptive_sink_dop

  • Описание: Specifies whether to enable adaptive parallelism for data loading. After this feature is enabled, the system automatically sets load parallelism for INSERT INTO and Broker Load jobs, which is equivalent to the mechanism of pipeline_dop. For a newly deployed v1.5.2 Selena cluster, the value is true by default. For a v1.5.2 cluster upgraded from v1.5.2, the value is false.
  • По умолчанию: false
  • Представлено в: v1.5.2

enable_bucket_aware_execution_on_lake

  • Описание: Whether to enable bucket-aware execution for queries against data lakes (such as Iceberg tables). When this feature is enabled, the system optimizes query execution by leveraging bucketing information to reduce data shuffling and improve performance. This optimization is particularly effective for join operations and aggregations on bucketed tables.
  • По умолчанию: true
  • Тип данных: Boolean
  • Представлено в: v2.0.0

lake_bucket_assign_mode

  • Описание: The bucket assignment mode for queries against tables in data lakes. This variable controls how buckets are distributed among worker nodes when bucket-aware execution takes effect during query execution. Valid values:
    • balance: Distributes buckets evenly across worker nodes to achieve balanced workload and better performance.
    • elastic: Uses consistent hashing to assign buckets to worker nodes, which can provide better load distribution in elastic environments.
  • По умолчанию: balance
  • Тип данных: String
  • Представлено в: v2.0.0

enable_pipeline_engine

  • Описание: Specifies whether to enable the pipeline execution engine. true indicates enabled and false indicates the opposite. Default value: true.
  • По умолчанию: true

enable_sort_aggregate

  • Описание: Specifies whether to enable sorted streaming. true indicates sorted streaming is enabled to sort data in data streams.
  • По умолчанию: false
  • Представлено в: v1.5.2

enable_global_runtime_filter

Whether to enable global runtime filter (RF for short). RF filters data at runtime. Data filtering often occurs in the Join stage. During multi-table joins, optimizations such as predicate pushdown are used to filter data, in order to reduce the number of scanned rows for Join and the I/O in the Shuffle stage, thereby speeding up the query.

Selena offers two types of RF: Local RF and Global RF. Local RF is suitable for Broadcast Hash Join and Global RF is suitable for Shuffle Join.

Default value: true, which means global RF is enabled. If this feature is disabled, global RF does not take effect. Local RF can still work.

enable_multicolumn_global_runtime_filter

Whether to enable multi-column global runtime filter. Default value: false, which means multi-column global RF is disabled.

If a Join (other than Broadcast Join and Replicated Join) has multiple equi-join conditions:

  • If this feature is disabled, only Local RF works.
  • If this feature is enabled, multi-column Global RF takes effect and carries multi-column in the partition by clause.

enable_write_hive_external_table

  • Описание: Whether to allow for sinking data to external tables of Hive.
  • По умолчанию: false
  • Представлено в: v1.5.2

enable_query_trigger_analyze

  • По умолчанию: true
  • Тип: Boolean
  • Описание: Whether to enable query-trigger ANALYZE tasks on tables under external catalogs.
  • Представлено в: v1.5.2

event_scheduler

Используется для совместимости с MySQL client. Не имеет практического применения.

enable_strict_type

  • Описание: Whether to allow implicit conversions for all compound predicates and for all expressions in the WHERE clause.
  • По умолчанию: false
  • Представлено в: v1.5.2

force_streaming_aggregate

Used to control whether the aggregation node enables streaming aggregation for computing. The default value is false, meaning the feature is not enabled.

forward_to_leader

Used to specify whether some commands will be forwarded to the leader FE for execution. Alias: forward_to_master. The default value is false, meaning not forwarding to the leader FE. There are multiple FEs in a Selena cluster, one of which is the leader FE. Normally, users can connect to any FE for full-featured operations. However, some information is only available on the leader FE.

For example, if the SHOW BACKENDS command is not forwarded to the leader FE, only basic information (for example, whether the node is alive) can be viewed. Forwarding to the leader FE can get more detailed information including the node start time and last heartbeat time.

The commands affected by this variable are as follows:

  • SHOW FRONTENDS: Forwarding to the leader FE allows users to view the last heartbeat message.

  • SHOW BACKENDS: Forwarding to the leader FE allows users to view the boot time, last heartbeat information, and disk capacity information.

  • SHOW BROKER: Forwarding to the leader FE allows users to view the boot time and last heartbeat information.

  • SHOW TABLET

  • ADMIN SHOW REPLICA DISTRIBUTION

  • ADMIN SHOW REPLICA STATUS: Forwarding to the leader FE allows users to view the tablet information stored in the metadata of the leader FE. Normally, the tablet information should be the same in the metadata of different FEs. If an error occurs, you can use this method to compare the metadata of the current FE and the leader FE.

  • Show PROC: Forwarding to the leader FE allows users to view the PROC information stored in the metadata. This is mainly used for metadata comparison.

group_concat_max_len

  • Описание: The maximum length of string returned by the group_concat function.
  • По умолчанию: 1024
  • Минимальное значение: 4
  • Единица измерения: Characters
  • Тип данных: Long

group_execution_max_groups

  • Описание: Maximum number of groups allowed for Group Execution. It is used to limit the granularity of splitting, preventing excessive scheduling overhead caused by an excessive number of groups.
  • По умолчанию: 128
  • Представлено в: v1.5.2

group_execution_min_scan_rows

  • Описание: Minimum number of rows processed per group for Group Execution.
  • По умолчанию: 5000000
  • Представлено в: v1.5.2

hash_join_push_down_right_table

  • Описание: Used to control whether the data of the left table can be filtered by using the filter condition against the right table in the Join query. If so, it can reduce the amount of data that needs to be processed during the query. По умолчанию: true indicates the operation is allowed and the system decides whether the left table can be filtered. false indicates the operation is disabled. The default value is true.

init_connect (global)

Используется для совместимости с MySQL client. Не имеет практического применения.

interactive_timeout

Используется для совместимости с MySQL client. Не имеет практического применения.

interpolate_passthrough

  • Описание: Whether to add local-exchange-passthrough for certain operators. Currently supported operators include streaming aggregates, etc. Adding local-exchange can mitigate the impact of data skew on computation, but will slightly increase memory usage.
  • По умолчанию: true
  • Представлено в: v1.5.2

io_tasks_per_scan_operator

  • Описание: The number of concurrent I/O tasks that can be issued by a scan operator. Increase this value if you want to access remote storage systems such as HDFS or S3 but the latency is high. However, a larger value causes more memory consumption.
  • По умолчанию: 4
  • Тип данных: Int
  • Представлено в: v1.5.2

jit_level

  • Описание: The level at which JIT compilation for expressions is enabled. Valid values:
    • 1: The system adaptively enables JIT compilation for compilable expressions.
    • -1: JIT compilation is enabled for all compilable, non-constant expressions.
    • 0: JIT compilation is disabled. You can disable it manually if any error is returned for this feature.
  • По умолчанию: 1
  • Тип данных: Int
  • Представлено в: -

language (global)

Используется для совместимости с MySQL client. Не имеет практического применения.

license (global)

  • Описание: Отображает информацию о лицензии Selena.
  • По умолчанию: Proprietary

load_mem_limit

Specifies the memory limit for the import operation. The default value is 0, meaning that this variable is not used and query_mem_limit is used instead.

This variable is only used for the INSERT operation which involves both query and import. If the user does not set this variable, the memory limit for both query and import will be set as exec_mem_limit. Otherwise, the memory limit for query will be set as exec_mem_limit and the memory limit for import will be as load_mem_limit.

Other import methods such as BROKER LOAD, STREAM LOAD still use exec_mem_limit for memory limit.

log_rejected_record_num (v1.5.2 and later)

Specifies the maximum number of unqualified data rows that can be logged. Valid values: 0, -1, and any non-zero positive integer. Default value: 0.

  • The value 0 specifies that data rows that are filtered out will not be logged.
  • The value -1 specifies that all data rows that are filtered out will be logged.
  • A non-zero positive integer such as n specifies that up to n data rows that are filtered out can be logged on each BE.

lower_case_table_names (global)

Используется для совместимости с MySQL client. Не имеет практического применения. Table names in Selena are case-sensitive.

lower_upper_support_utf8

  • По умолчанию: false
  • Тип: Boolean
  • Единица измерения: -
  • Описание: Whether to support case conversion for UTF-8 characters in lower and upper functions. Valid values:
    • true: Support case conversion for UTF-8 characters.
    • false (Default): Not to support case conversion for UTF-8 characters.
  • Представлено в: v1.5.2

low_cardinality_optimize_on_lake

  • По умолчанию: true
  • Тип: Boolean
  • Единица измерения: -
  • Описание: Whether to enable low cardinality optimization on data lake queries. Valid values:
    • true (Default): Enable low cardinality optimization on data lake queries.
    • false: Disable low cardinality optimization on data lake queries.
  • Представлено в: v1.5.2

materialized_view_rewrite_mode (v1.5.2 and later)

Specifies the query rewrite mode of asynchronous materialized views. Valid values:

  • disable: Disable automatic query rewrite of asynchronous materialized views.
  • default (Default value): Enable automatic query rewrite of asynchronous materialized views, and allow the optimizer to decide whether a query can be rewritten using the materialized view based on the cost. If the query cannot be rewritten, it directly scans the data in the base table.
  • default_or_error: Enable automatic query rewrite of asynchronous materialized views, and allow the optimizer to decide whether a query can be rewritten using the materialized view based on the cost. If the query cannot be rewritten, an error is returned.
  • force: Enable automatic query rewrite of asynchronous materialized views, and the optimizer prioritizes query rewrite using the materialized view. If the query cannot be rewritten, it directly scans the data in the base table.
  • force_or_error: Enable automatic query rewrite of asynchronous materialized views, and the optimizer prioritizes query rewrite using the materialized view. If the query cannot be rewritten, an error is returned.

max_allowed_packet

  • Описание: Used for compatibility with the JDBC connection pool C3P0. This variable specifies the maximum size of packets that can be transmitted between the client and server.
  • По умолчанию: 33554432 (32 MB). You can raise this value if the client reports "PacketTooBigException".
  • Единица измерения: Byte
  • Тип данных: Int

max_pushdown_conditions_per_column

  • Описание: The maximum number of predicates that can be pushed down for a column.
  • По умолчанию: -1, indicating that the value in the be.conf file is used. If this variable is set to a value greater than 0, the value in be.conf is ignored.
  • Тип данных: Int

max_scan_key_num

  • Описание: The maximum number of scan key segmented by each query.
  • По умолчанию: -1, indicating that the value in the be.conf file is used. If this variable is set to a value greater than 0, the value in be.conf is ignored.

nested_mv_rewrite_max_level

  • Описание: The maximum levels of nested materialized views that can be used for query rewrite.
  • Диапазон значений: [1, +∞). The value of 1 indicates that only materialized views created on base tables can be used for query rewrite.
  • По умолчанию: 3
  • Тип данных: Int

net_buffer_length

Используется для совместимости с MySQL client. Не имеет практического применения.

net_read_timeout

Используется для совместимости с MySQL client. Не имеет практического применения.

net_write_timeout

Используется для совместимости с MySQL client. Не имеет практического применения.

new_planner_optimize_timeout

  • Описание: The timeout duration of the query optimizer. When the optimizer times out, an error is returned and the query is stopped, which affects the query performance. You can set this variable to a larger value based on your query or contact Selena technical support for troubleshooting. A timeout often occurs when a query has too many joins.
  • По умолчанию: 3000
  • Единица измерения: ms

parallel_exchange_instance_num

Used to set the number of exchange nodes that an upper-level node uses to receive data from a lower-level node in the execution plan. The default value is -1, meaning the number of exchange nodes is equal to the number of execution instances of the lower-level node. When this variable is set to be greater than 0 but smaller than the number of execution instances of the lower-level node, the number of exchange nodes equals the set value.

In a distributed query execution plan, the upper-level node usually has one or more exchange nodes to receive data from the execution instances of the lower-level node on different BEs. Usually the number of exchange nodes is equal to the number of execution instances of the lower-level node.

In some aggregation query scenarios where the amount of data decreases drastically after aggregation, you can try to modify this variable to a smaller value to reduce the resource overhead. An example would be running aggregation queries using the Duplicate Key table.

parallel_fragment_exec_instance_num

Used to set the number of instances used to scan nodes on each BE. The default value is 1.

A query plan typically produces a set of scan ranges. This data is distributed across multiple BE nodes. A BE node will have one or more scan ranges, and by default, each BE node's set of scan ranges is processed by only one execution instance. When machine resources suffice, you can increase this variable to allow more execution instances to process a scan range simultaneously for efficiency purposes.

The number of scan instances determines the number of other execution nodes in the upper level, such as aggregation nodes and join nodes. Therefore, it increases the concurrency of the entire query plan execution. Modifying this variable will help improve efficiency, but larger values will consume more machine resources, such as CPU, memory, and disk IO.

parallel_merge_late_materialization_mode

  • Описание: The late materialization mode of parallel merge for sorting. Valid values:
    • AUTO
    • ALWAYS
    • NEVER
  • По умолчанию: AUTO
  • Представлено в: v1.5.2

partial_update_mode

  • Описание: Used to control the mode of partial updates. Valid values:

    • auto (default): The system automatically determines the mode of partial updates by analyzing the UPDATE statement and the columns involved.
    • column: The column mode is used for the partial updates, which is particularly suitable for the partial updates which involve a small number of columns and a large number of rows.

    For more information, see UPDATE.

  • По умолчанию: auto

  • Представлено в: v1.5.2

performance_schema (global)

Used for compatibility with MySQL JDBC versions 8.0.16 and above. No practical usage.

prefer_compute_node

  • Описание: Specifies whether the FEs distribute query execution plans to CN nodes. Valid values:
    • true: indicates that the FEs distribute query execution plans to CN nodes.
    • false: indicates that the FEs do not distribute query execution plans to CN nodes.
  • По умолчанию: false
  • Представлено в: v1.5.2

pipeline_dop

  • Описание: The parallelism of a pipeline instance, which is used to adjust the query concurrency. Default value: 0, indicating the system automatically adjusts the parallelism of each pipeline instance. This variable also controls the parallelism of loading jobs on OLAP tables. You can also set this variable to a value greater than 0. Generally, set the value to half the number of physical CPU cores. From v1.5.2 onwards, Selena adaptively adjusts this variable based on query parallelism.

  • По умолчанию: 0

  • Тип данных: Int

pipeline_sink_dop

  • Описание: The parallelism of sink for loading data into Iceberg tables and Hive tables, and unloading data using INSERT INTO FILES(). It is used to adjust the concurrency of these loading jobs. Default value: 0, indicating the system automatically adjusts the parallelism. You can also set this variable to a value greater than 0.
  • По умолчанию: 0
  • Тип данных: Int

pipeline_profile_level

  • Описание: Controls the level of the query profile. A query profile often has five layers: Fragment, FragmentInstance, Pipeline, PipelineDriver, and Operator. Different levels provide different details of the profile:

    • 0: Selena combines metrics of the profile and shows only a few core metrics.
    • 1: default value. Selena simplifies the profile and combines metrics of the profile to reduce profile layers.
    • 2: Selena retains all the layers of the profile. The profile size is large in this scenario, especially when the SQL query is complex. This value is not recommended.
  • По умолчанию: 1

  • Тип данных: Int

query_cache_entry_max_bytes

  • Описание: The threshold for triggering the Passthrough mode. When the number of bytes or rows from the computation results of a specific tablet accessed by a query exceeds the threshold specified by query_cache_entry_max_bytes or query_cache_entry_max_rows, the query is switched to Passthrough mode.
  • Допустимые значения: 0 to 9223372036854775807
  • По умолчанию: 4194304
  • Единица измерения: Byte
  • Представлено в: v1.5.2

query_cache_entry_max_rows

  • Описание: The upper limit of rows that can be cached. See the description in query_cache_entry_max_bytes. Default value: .
  • По умолчанию: 409600
  • Представлено в: v1.5.2

query_cache_agg_cardinality_limit

  • Описание: The upper limit of cardinality for GROUP BY in Query Cache. Query Cache is not enabled if the rows generated by GROUP BY exceeds this value. Default value: 5000000. If query_cache_entry_max_bytes or query_cache_entry_max_rows is set to 0, the Passthrough mode is used even when no computation results are generated from the involved tablets.
  • По умолчанию: 5000000
  • Тип данных: Long
  • Представлено в: v1.5.2

query_cache_size (global)

Used for MySQL client compatibility. No practical use.

query_cache_type

Used for compatibility with JDBC connection pool C3P0. No practical use.

query_mem_limit

  • Описание: Used to set the memory limit of a query on each BE node. The default value is 0, which means no limit for it. This item takes effect only after Pipeline Engine is enabled. When the Memory Exceed Limit error happens, you could try to increase this variable. Setting it to 0 indicates no limit is imposed.
  • По умолчанию: 0
  • Единица измерения: Byte

query_queue_concurrency_limit (global)

  • Описание: The upper limit of concurrent queries on a BE. It takes effect only after being set greater than 0. Setting it to 0 indicates no limit is imposed.
  • По умолчанию: 0
  • Тип данных: Int

query_queue_cpu_used_permille_limit (global)

  • Описание: The upper limit of CPU usage permille (CPU usage * 1000) on a BE. It takes effect only after being set greater than 0. Setting it to 0 indicates no limit is imposed.
  • Диапазон значений: [0, 1000]
  • По умолчанию: 0

query_queue_max_queued_queries (global)

  • Описание: The upper limit of queries in a queue. When this threshold is reached, incoming queries are rejected. It takes effect only after being set greater than 0. Setting it to 0 indicates no limit is imposed.
  • По умолчанию: 1024.

query_queue_mem_used_pct_limit (global)

  • Описание: The upper limit of memory usage percentage on a BE. It takes effect only after being set greater than 0. Setting it to 0 indicates no limit is imposed.
  • Диапазон значений: [0, 1]
  • По умолчанию: 0

query_queue_pending_timeout_second (global)

  • Описание: The maximum timeout of a pending query in a queue. When this threshold is reached, the corresponding query is rejected.
  • По умолчанию: 300
  • Единица измерения: Second

query_timeout

  • Описание: Used to set the query timeout in "seconds". This variable will act on all query statements in the current connection. The default value is 300 seconds. From v1.5.2 onwards, query_timeout does not apply to operations involved INSERT (for example, UPDATE, DELETE, CTAS, materialized view refresh, statistics collection, and PIPE).
  • Диапазон значений: [1, 259200]
  • По умолчанию: 300
  • Тип данных: Int
  • Единица измерения: Second

range_pruner_max_predicate

  • Описание: The maximum number of IN predicates that can be used for Range partition pruning. Default value: 100. A value larger than 100 may cause the system to scan all tablets, which compromises the query performance.
  • По умолчанию: 100
  • Представлено в: v1.5.2

rewrite_count_distinct_to_bitmap_hll

Used to decide whether to rewrite count distinct queries to bitmap_union_count and hll_union_agg.

runtime_filter_on_exchange_node

  • Описание: Whether to place GRF on Exchange Node after GRF is pushed down across the Exchange operator to a lower-level operator. The default value is false, which means GRF will not be placed on Exchange Node after it is pushed down across the Exchange operator to a lower-level operator. This prevents repetitive use of GRF and reduces the computation time.

    However, GRF delivery is a "try-best" process. If the lower-level operator fails to receive the GRF but the GRF is not placed on Exchange Node, data cannot be filtered, which compromises filter performance. true means GRF will still be placed on Exchange Node even after it is pushed down across the Exchange operator to a lower-level operator.

  • По умолчанию: false

runtime_join_filter_push_down_limit

  • Описание: The maximum number of rows allowed for the Hash table based on which Bloom filter Local RF is generated. Local RF will not be generated if this value is exceeded. This variable prevents the generation of an excessively long Local RF.
  • По умолчанию: 1024000
  • Тип данных: Int

runtime_profile_report_interval

  • Описание: The time interval at which runtime profiles are reported.
  • По умолчанию: 10
  • Единица измерения: Second
  • Тип данных: Int
  • Представлено в: v1.5.2

scan_olap_partition_num_limit

  • Описание: The number of partitions allowed to be scanned for a single table in the execution plan.
  • По умолчанию: 0 (No limit)
  • Представлено в: v1.5.2

spill_mode (3.0 and later)

The execution mode of intermediate result spilling. Valid values:

  • auto: Spilling is automatically triggered when the memory usage threshold is reached.
  • force: Selena forcibly executes spilling for all relevant operators, regardless of memory usage.

This variable takes effect only when the variable enable_spill is set to true.

spill_storage_volume

  • Описание: The storage volume with which you want to store the intermediate results of queries that triggered spilling. For more information, see Spill to object storage.
  • По умолчанию: Empty string
  • Представлено в: v1.5.2

SQL_AUTO_IS_NULL

Used for compatibility with the JDBC connection pool C3P0. No practical usage.

sql_dialect

  • Описание: The SQL dialect that is used. For example, you can run the set sql_dialect = 'trino'; command to set the SQL dialect to Trino, so you can use Trino-specific SQL syntax and functions in your queries.

    NOTICE

    After you configure Selena to use the Trino dialect, identifiers in queries are not case-sensitive by default. Therefore, you must specify names in lowercase for your databases and tables at database and table creation. If you specify database and table names in uppercase, queries against these databases and tables will fail.

  • Тип данных: Selena

  • Представлено в: v1.5.2

sql_mode

Used to specify the SQL mode to accommodate certain SQL dialects. Valid values include:

  • PIPES_AS_CONCAT: The pipe symbol | is used to concatenate strings, for example, select 'hello ' || 'world'.
  • ONLY_FULL_GROUP_BY (Default): The SELECT LIST can only contain GROUP BY columns or aggregate functions.
  • ALLOW_THROW_EXCEPTION: returns an error instead of NULL when type conversion fails.
  • FORBID_INVALID_DATE: prohibits invalid dates.
  • MODE_DOUBLE_LITERAL: interprets floating-point types as DOUBLE rather than DECIMAL.
  • SORT_NULLS_LAST: places NULL values at the end after sorting.
  • ERROR_IF_OVERFLOW: returns an error instead of NULL in the case of arithmetic overflow. Currently, only the DECIMAL data type supports this option.
  • GROUP_CONCAT_LEGACY: uses the group_concat syntax of earlier versions. This option is supported from v1.5.2.

You can set only one SQL mode, for example:

set sql_mode = 'PIPES_AS_CONCAT';

Or, you can set multiple modes at a time, for example:

set sql_mode = 'PIPES_AS_CONCAT,ERROR_IF_OVERFLOW,GROUP_CONCAT_LEGACY';

sql_safe_updates

Используется для совместимости с MySQL client. Не имеет практического применения.

sql_select_limit

  • Описание: Used to limit the maximum number of rows returned by a query, which can prevent issues such as insufficient memory or network congestion caused by the query returning too much data.
  • По умолчанию: Unlimited
  • Тип данных: Long

statistic_collect_parallel

  • Описание: Used to adjust the parallelism of statistics collection tasks that can run on BEs. Default value: 1. You can increase this value to speed up collection tasks.
  • По умолчанию: 1
  • Тип данных: Int

storage_engine

The types of engines supported by Selena:

  • olap (default): Selena system-owned engine.
  • mysql: MySQL external tables.
  • broker: Access external tables through a broker program.
  • elasticsearch or es: Elasticsearch external tables.
  • hive: Hive external tables.
  • iceberg: Iceberg external tables, supported from v1.5.2.
  • hudi: Hudi external tables, supported from v1.5.2.
  • jdbc: external table for JDBC-compatible databases, supported from v1.5.2.

streaming_preaggregation_mode

Used to specify the preaggregation mode for the first phase of GROUP BY. If the preaggregation effect in the first phase is not satisfactory, you can use the streaming mode, which performs simple data serialization before streaming data to the destination. Valid values:

  • auto: The system first tries local preaggregation. If the effect is not satisfactory, it switches to the streaming mode. This is the default value.
  • force_preaggregation: The system directly performs local preaggregation.
  • force_streaming: The system directly performs streaming.

system_time_zone

Used to display the time zone of the current system. Cannot be changed.

time_zone

Used to set the time zone of the current session. The time zone can affect the results of certain time functions.

trace_log_mode

  • Описание: Used to control where to output the logs of query trace profiles. Valid values:

    • command: Return query trace profile logs as the Explain String after executing TRACE LOGS.
    • file: Return query trace profile logs in the FE log file fe.log with the class name being FileLogTracer.
  • По умолчанию: command

  • Тип данных: String

  • Представлено в: v1.5.2

transaction_read_only

  • Описание: Used for MySQL 5.8 compatibility. The alias is tx_read_only. This variable specifies the transaction access mode. ON indicates read only and OFF indicates readable and writable.
  • По умолчанию: OFF
  • Представлено в: v1.5.2

tx_isolation

Используется для совместимости с MySQL client. Не имеет практического применения. The alias is transaction_isolation.

use_compute_nodes

  • Описание: The maximum number of CN nodes that can be used. This variable is valid when prefer_compute_node=true. Valid values:

    • -1: indicates that all CN nodes are used.
    • 0: indicates that no CN nodes are used.
  • По умолчанию: -1

  • Тип данных: Int

  • Представлено в: v1.5.2

use_v2_rollup

Used to control the query to fetch data using the rollup index of the segment v2 storage format. This variable is used for validation when going online with segment v2. It is not recommended for other cases.

vectorized_engine_enable (deprecated from v1.5.2 onwards)

Used to control whether the vectorized engine is used to execute queries. A value of true indicates that the vectorized engine is used, otherwise the non-vectorized engine is used. The default is true. This feature is enabled by default from v1.5.2 onwards and therefore, is deprecated.

version (global)

The MySQL server version returned to the client. The value is the same as FE parameter mysql_server_version.

version_comment (global)

The Selena version. Cannot be changed.

wait_timeout

  • Описание: The number of seconds the server waits for activity on a non-interactive connection before closing it. If a client does not interact with Selena for this length of time, Selena will actively close the connection.
  • По умолчанию: 28800 (8 hours).
  • Единица измерения: Second
  • Тип данных: Int

orc_use_column_names

  • Описание: Used to specify how columns are matched when Selena reads ORC files from Hive. The default value is false, which means columns in ORC files are read based on their ordinal positions in the Hive table definition. If this variable is set to true, columns are read based on their names.
  • По умолчанию: false
  • Представлено в: v1.5.2

enable_phased_scheduler

  • Описание: Whether to enable multi-phased scheduling. When multi-phased scheduling is enabled, it will schedule fragments according to their dependencies. For example, the system will first schedule the fragment on the build side of a Shuffle Join, and then the fragment on the probe side (Note that, unlike stage-by-stage scheduling, phased scheduling is still under the MPP execution mode). Enabling multi-phased scheduling can significantly reduce memory usage for a large number of UNION ALL queries.
  • По умолчанию: false
  • Представлено в: v1.5.2

phased_scheduler_max_concurrency

  • Описание: The concurrency for phased scheduler scheduling leaf node fragments. For example, the default value means that, in a large number of UNION ALL Scan queries, at most two scan fragments are allowed to be scheduled at the same time.
  • По умолчанию: 2
  • Представлено в: v1.5.2

enable_wait_dependent_event

  • Описание: Whether Pipeline waits for a dependent operator to finish execution before continuing within the same fragment. For example, in a left join query, when this feature is enabled, the probe-side operator waits for the build-side operator to finish before it starts executing. Enabling this feature can reduce memory usage, but may increase the query latency. However, for queries reused in CTE, enabling this feature may increase memory usage.
  • По умолчанию: false
  • Представлено в: v1.5.2

enable_topn_runtime_filter

  • Описание: Whether to enable TopN Runtime Filter. If this feature is enabled, a runtime filter will be dynamically constructed for ORDER BY LIMIT queries and pushed down to the scan for filtering.
  • По умолчанию: true
  • Представлено в: v1.5.2

enable_partition_hash_join

  • Описание: Whether to enable adaptive Partition Hash Join.
  • По умолчанию: true
  • Представлено в: v1.5.2

spill_enable_direct_io

  • Описание: Whether to skip Page Cache when reading or writing files for Spilling. If this feature is enabled, Spilling will use direct I/O mode to read or write files directly. Direct I/O mode can reduce the impact on the OS Page Cache, but it may cause increases in disk read/write time.
  • По умолчанию: false
  • Представлено в: v1.5.2

spill_enable_compaction

  • Описание: Whether to enable Compaction for small files from Spilling. When this feature is enabled, it reduces memory usage for aggregation and sorting.
  • По умолчанию: true
  • Представлено в: v1.5.2