This topic describes the compute layer parameters for PolarDB-X.
Only PolarDB-X Enterprise instances support compute layer parameters.
Variable name | Restart required | Default value | Scope | Description |
PLAN_CACHE | No | FALSE | [TRUE|FALSE] | Enables or disables the plan cache. |
ENABLE_RECYCLEBIN | No | FALSE | [TRUE|FALSE] | Enables or disables the recycle bin. |
SHOW_TABLES_CACHE | No | FALSE | [TRUE|FALSE] | Controls whether to cache the results of |
MERGE_CONCURRENT | No | FALSE | [TRUE|FALSE] | Enables or disables full parallel execution. This parameter mainly affects the degree of parallelism (DOP) for Data Definition Language (DDL) statements and simple queries that are fully pushed down. |
MERGE_UNION | No | FALSE | [TRUE|FALSE] | This parameter is disabled by default. If you enable it, |
MERGE_UNION_SIZE | No | -1 | [0-10000] | The number of physical SQL statements to merge using |
TABLE_META_CACHE_EXPIRE_TIME | No | 300 | [0-180000] | The time-to-live (TTL) for the metadata cache. |
COLUMN_LABEL_INSENSITIVE | No | TRUE | [FALSE|TRUE] | Controls whether returned column labels are case-sensitive. |
RECORD_SQL | No | TRUE | [FALSE|TRUE] | Enables or disables the audit log. |
SOCKET_TIMEOUT | No | 900000 | [0~3600000] | The connection timeout for physical SQL statements. |
TRANSACTION_POLICY | No | TSO | [XA|TSO|TSO_READONLY] | The transaction policy. |
SHARE_READ_VIEW | No | FALSE | [TRUE|FALSE] | Enables or disables the shared ReadView feature. |
ENABLE_TRX_SINGLE_SHARD_OPTIMIZATION | No | TRUE | [TRUE|FALSE] | Enables or disables single-shard optimization for transactions. |
GET_TSO_TIMEOUT | No | 10 | [1-1800] | The timeout for getting a Timestamp Oracle (TSO) timestamp. |
MAX_TRX_DURATION | No | 28800 | [1-180000] | The physical timeout for a transaction. |
TRANSACTION_ISOLATION | No | REPEATABLE-READ | [READ-UNCOMMITTED|READ-COMMITTED|REPEATABLE-READ|SERIALIZABLE] | The transaction isolation level. |
GROUP_CONCURRENT_BLOCK | No | TRUE | [TRUE|FALSE] | The execution policy at the database sharding level when not in Massively Parallel Processing (MPP) mode. |
SEQUENTIAL_CONCURRENT_POLICY | No | FALSE | [TRUE|FALSE] | The sequential execution policy for concurrent requests when not in MPP mode. |
DML_SKIP_DUPLICATE_CHECK_FOR_PK | No | TRUE | [TRUE|FALSE] | Controls whether to skip the primary key conflict check during the execution of Data Manipulation Language (DML) statements. |
DML_SKIP_CRUCIAL_ERR_CHECK | No | FALSE | [TRUE|FALSE] | Controls whether to allow a transaction with DML errors to be committed. |
DML_USE_RETURNING | No | TRUE | [TRUE|FALSE] | Controls whether to use the `RETURNING` clause for optimization. |
BROADCAST_DML | No | FALSE | [TRUE|FALSE] | Controls whether writes to broadcast tables can bypass distributed transactions. |
SEQUENCE_STEP | No | 10000 | [1-10000000] | The step size for a sequence. The default value is 100,000. |
MERGE_DDL_TIMEOUT | No | 0 | [1-10000000] | The timeout for a physical DDL connection. The default value is 0, which means no timeout. |
MERGE_DDL_CONCURRENT | No | FALSE | [FALSE|TRUE] | Controls whether to execute DDL statements in full parallel mode. By default, DDL statements are executed with database-level concurrency. |
SLOW_SQL_TIME | No | 1000 | [1-180000] | The threshold for a slow SQL statement. |
LOAD_DATA_BATCH_INSERT_SIZE | No | 1024 | [1-180000] | The number of records in each batch insert for a `LOAD DATA` statement. |
LOAD_DATA_CACHE_BUFFER_SIZE | No | 60 | [1-180000] | The cache buffer size for `LOAD DATA` statements. The default value is 60 MB. This parameter is mainly used for throttling. |
MAX_ALLOWED_PACKET | No | 16777216 | [4194304-33554432] | The maximum packet size. |
KILL_CLOSE_STREAM | No | FALSE | [FALSE|TRUE] | Enables or disables the early termination feature for physical connection streams. |
ALLOW_SIMPLE_SEQUENCE | No | FALSE | [FALSE|TRUE] | Controls whether to allow the use of simple sequences. |
MAX_PARAMETERIZED_SQL_LOG_LENGTH | No | 5000 | [1-1000000] | The maximum length of a parameterized SQL statement that can be printed in the log. |
FORBID_EXECUTE_DML_ALL | No | TRUE | [TRUE|FALSE] | Controls whether to prohibit full-table `DELETE` and `UPDATE` operations. |
GROUP_SEQ_CHECK_INTERVAL | Yes | 60 | [1-36000] | The interval for checking explicitly inserted values. Unit: seconds. |
JOIN_BLOCK_SIZE | Yes | 300 | [1-100000] | The number of `IN` values for a Batched Key Access (BKA) join when dynamic pruning is disabled. |
LOOKUP_JOIN_MAX_BATCH_SIZE | Yes | 6400 | [1-100000] | The maximum number of `IN` values for a BKA join. |
LOOKUP_JOIN_MIN_BATCH_SIZE | Yes | 100 | [1-100000] | The minimum number of `IN` values for a BKA join. |
PURGE_TRANS_INTERVAL | Yes | 300 | [1-180000] | The interval for purging transaction logs. |
PURGE_TRANS_BEFORE | Yes | 1800 | [1-180000] | The age of transaction logs to purge. The system purges logs older than this value. |
ENABLE_BACKGROUND_STATISTIC_COLLECTION | No | TRUE | [TRUE|FALSE] | Controls whether to enable background collection of statistics. |
GENERAL_DYNAMIC_SPEED_LIMITATION | No | -1 | [-1-10000000] | The dynamic speed limit for data backfill and validation. The default value is -1, which indicates a limit of 10,000 rows per second. |
PARALLELISM | No | -1 | [1-1024] | The DOP for a single node. By default, the system determines this value based on the node specifications. |
LOGICAL_DB_TIME_ZONE | No | SYSTEM | [SYSTEM|±HH:mm] | The time zone of the database. |
MPP_PARALLELISM | No | -1 | [1-1024] | The DOP for the MPP execution mode. By default, the system determines this value based on the node specifications. |
DATABASE_PARALLELISM | No | 0 | [0-1024] | The number of SQL statements that a single query can concurrently send to one data node (DN). This value is used to calculate the DOP for scan operations. |
POLARDBX_PARALLELISM | No | 0 | [0-1024] | The maximum DOP for a single query on one compute node (CN). The default value is the number of CPU cores. |
MPP_METRIC_LEVEL | No | 3 | [0|1|2|3] | The level of detail for collecting performance statistics during computation. A higher level indicates a finer collection granularity. |
ENABLE_COMPLEX_DML_CROSS_DB | No | TRUE | [TRUE|FALSE] | Controls whether to support complex DML statements across databases. |
PER_QUERY_MEMORY_LIMIT | Yes | -1 | [-1-9223372036854775807] | The memory limit for the query-level memory pool. The default value is one-third of the global connection pool size. |
ENABLE_SPILL | No | FALSE | [FALSE|TRUE] | Enables or disables spilling temporary tables to disk. |
CONN_POOL_MIN_POOL_SIZE | No | 20 | [0-60] | The minimum number of connections to a physical database shard. |
CONN_POOL_MAX_POOL_SIZE | No | 60 | [1-1600] | The maximum number of connections to a physical database shard. |
CONN_POOL_MAX_WAIT_THREAD_COUNT | No | 0 | [-1-8192] | The maximum number of threads waiting for a connection to a single database shard. This parameter is for the Druid connection pool. |
CONN_POOL_IDLE_TIMEOUT | No | 30 | [1-60] | The timeout for an idle physical connection. |
CONN_POOL_BLOCK_TIMEOUT | No | 5000 | [1000-60000] | The maximum time to wait for a connection from the physical connection pool. |
CONN_POOL_XPROTO_MAX_POOLED_SESSION_PER_INST | No | 512 | [1-8192] | The maximum number of cached sessions per storage node. This applies to sessions that use the proprietary protocol. |
XPROTO_MAX_DN_CONCURRENT | No | 500 | [1-8192] | The maximum number of concurrent requests per storage node. This applies to requests that use the proprietary protocol. On October 23, 2023, the default value was changed to 2000 to meet the needs of most production and stress testing scenarios. |
XPROTO_MAX_DN_WAIT_CONNECTION | No | 32 | [1-8192] | The maximum number of waiting requests per storage node. This applies to requests that use the proprietary protocol. On June 13, 2024, the default value was changed to 2000 to meet the needs of most production and stress testing scenarios. |
MERGE_SORT_BUFFER_SIZE | No | 2048 | [1024-81920] | The buffer size for merge sort operations at the TableScan layer. The default value is 2 MB. |
WORKLOAD_TYPE | No | [AP|TP] | The workload type for a query. If not specified, the system automatically identifies the workload type based on cost. | |
EXECUTOR_MODE | No | [MPP|TP_LOCAL|AP_LOCAL] | The execution mode for a query. If not specified, the system selects an execution mode based on the workload type. | |
ENABLE_MASTER_MPP | No | FALSE | [TRUE|FALSE] | Controls whether to enable the MPP feature on the primary instance. |
LOOKUP_JOIN_BLOCK_SIZE_PER_SHARD | Yes | 50 | [1-100000] | The number of `IN` values per shard for a BKA join when pruning is enabled. |
ENABLE_RUNTIME_FILTER | No | TRUE | [TRUE|FALSE] | Enables or disables the runtime filter. |
FEEDBACK_WORKLOAD_AP_THRESHOLD | No | FALSE | [TRUE|FALSE] | Enables or disables hybrid transactional and analytical processing (HTAP) feedback for analytical processing (AP) queries. |
FEEDBACK_WORKLOAD_TP_THRESHOLD | No | FALSE | [TRUE|FALSE] | Enables or disables HTAP feedback for transactional processing (TP) queries. |
MASTER_READ_WEIGHT | No | -1 | [0-100] | A value that determines read traffic distribution. The percentage of traffic routed to read-only data nodes is calculated as `(100 - MASTER_READ_WEIGHT)`. The rest is routed to the primary instance's data nodes. |
SHOW_ALL_PARAMS | No | FALSE | [TRUE|FALSE] | Controls whether `SHOW VARIABLES` displays all parameters. |
FORCE_READ_OUTSIDE_TX | No | FALSE | [TRUE|FALSE] | Controls whether to forcibly open multiple connections to a single database shard within a transaction. |
ENABLE_COROUTINE | Yes | FALSE | [TRUE|FALSE] | Enables or disables the Wisp coroutine. |
TRUNCATE_TABLE_WITH_GSI | No | FALSE | [TRUE|FALSE] | Controls whether to allow `TRUNCATE TABLE` on tables that have a global secondary index (GSI). |
DDL_ON_GSI | No | FALSE | [TRUE|FALSE] | Controls whether to allow DDL statements to be executed directly on GSI tables. |
DML_ON_GSI | No | FALSE | [TRUE|FALSE] | Controls whether to allow DML statements to be executed directly on GSI tables. |
ENABLE_HASH_JOIN | No | TRUE | [TRUE|FALSE] | Controls whether the optimizer can generate HashJoin nodes during query plan optimization. |
ENABLE_BKA_JOIN | No | TRUE | [TRUE|FALSE] | Controls whether the optimizer can generate BKAJoin nodes during query plan optimization. |
ENABLE_NL_JOIN | No | TRUE | [TRUE|FALSE] | Controls whether the optimizer can generate NLJoin nodes during query plan optimization. |
ENABLE_SEMI_NL_JOIN | No | TRUE | [TRUE|FALSE] | Controls whether the optimizer can convert a SemiJoin to an NLJoin during query plan optimization. |
ENABLE_SEMI_HASH_JOIN | No | TRUE | [TRUE|FALSE] | Controls whether the optimizer can convert a SemiJoin to a HashJoin during query plan optimization. |
ENABLE_SEMI_BKA_JOIN | No | TRUE | [TRUE|FALSE] | Controls whether the optimizer can convert a SemiJoin to a BKAJoin during query plan optimization. |
ENABLE_SEMI_SORT_MERGE_JOIN | No | TRUE | [TRUE|FALSE] | Controls whether the optimizer can convert a SemiJoin to a MergeJoin during query plan optimization. |
ENABLE_MATERIALIZED_SEMI_JOIN | No | TRUE | [TRUE|FALSE] | Controls whether the optimizer can convert a SemiJoin to a MaterializedJoin during query plan optimization. |
ENABLE_SEMI_JOIN_REORDER | No | TRUE | [TRUE|FALSE] | Controls whether the optimizer can include SemiJoin in Cost-Based Optimizer (CBO) reordering. |
ENABLE_HASH_AGG | No | TRUE | [TRUE|FALSE] | Controls whether the optimizer can generate HashAgg nodes. |
ENABLE_PARTIAL_AGG | No | TRUE | [TRUE|FALSE] | Controls whether the optimizer can split an aggregation into two stages. |
ENABLE_SORT_AGG | No | TRUE | [TRUE|FALSE] | Controls whether the optimizer can generate SortAgg nodes. |
ENABLE_PUSH_PROJECT | No | TRUE | [TRUE|FALSE] | Controls whether the optimizer can perform Project pushdown. |
ENABLE_PUSH_JOIN | No | TRUE | [TRUE|FALSE] | Controls whether the optimizer can perform Join pushdown. |
ENABLE_PUSH_AGG | No | TRUE | [TRUE|FALSE] | Controls whether the optimizer can perform Aggregation pushdown. |
ENABLE_CBO_PUSH_AGG | No | TRUE | [TRUE|FALSE] | Controls whether the optimizer can push an aggregation through a join. |
ENABLE_PUSH_SORT | No | TRUE | [TRUE|FALSE] | Controls whether the optimizer can perform Sort pushdown. |
ENABLE_STATISTIC_FEEDBACK | No | TRUE | [TRUE|FALSE] | Controls whether to enable feedback-based statistics correction. |
ENABLE_CBO_PUSH_JOIN | No | TRUE | [TRUE|FALSE] | Controls whether the optimizer can perform join pass-through optimization. |
ENABLE_SORT_JOIN_TRANSPOSE | No | TRUE | [TRUE|FALSE] | Controls whether the optimizer can push a sort through a join. |
CHUNK_SIZE | No | 1024 | [1-10240] | The batch size for the executor. The executor processes data in batches of this size. |
ENABLE_SORT_MERGE_JOIN | No | TRUE | [TRUE|FALSE] | Controls whether the optimizer can generate SortMergeJoin nodes during query plan optimization. |
ENABLE_BKA_PRUNING | No | TRUE | [TRUE|FALSE] | Enables or disables the pruning feature for BKA joins. |
ENABLE_SPM | No | TRUE | [TRUE|FALSE] | Specifies whether execution plan management is enabled. |
ENABLE_EXPRESSION_VECTORIZATION | No | TRUE | [TRUE|FALSE] | Enables or disables vectorization for expressions. |
FORCE_DDL_ON_LEGACY_ENGINE | No | TRUE | [TRUE|FALSE] | Specifies whether the new DDL engine is enabled. |
PURE_ASYNC_DDL_MODE | No | FALSE | [TRUE|FALSE] | Controls whether to execute DDL tasks in non-blocking (asynchronous) mode. If enabled, the client returns immediately after submitting a DDL statement. You can check the execution status by running `SHOW [FULL] DDL`. |
DDL_JOB_REQUEST_TIMEOUT | No | 90000 | [1-9223372036854775807] | The maximum timeout for a DDL job. The default value is 25 days. |
LOGICAL_DDL_PARALLELISM | No | 1 | [1-10240] | The DOP for logical DDL execution. A value of 1 means DDL tasks are executed sequentially. |
ENABLE_BROADCAST_RANDOM_READ | No | TRUE | [TRUE|FALSE] | Enables or disables random read optimization for broadcast tables. |
STORAGE_DELAY_THRESHOLD | No | 16777216s | [0-16777216] | The synchronization latency threshold for a DN as perceived by a CN. If the latency of a read-only DN exceeds this threshold, read traffic is handled based on the `DELAY_EXECUTION_STRATEGY` policy. |
DELAY_EXECUTION_STRATEGY | No | CONTINUE_TO_SLAVE | [CONTINUE_TO_SLAVE | CHANGE_TO_MASTER | THROW_EXCEPTION] | The policy to use when the latency of a read-only DN exceeds the `STORAGE_DELAY_THRESHOLD`. Valid values:
|
STORAGE_BUSY_THRESHOLD | No | 100 | [0-16777216] | The threshold for the number of active threads on a read-only DN. If a read-only DN's active thread count exceeds this threshold, it is considered busy, and the router avoids sending read traffic to it. If all read-only DNs are busy, traffic is routed to a random read-only DN. |
ENABLE_CONSISTENT_REPLICA_READ | No | TRUE | [TRUE|FALSE] | Enables or disables consistent reads from replicas. TRUE: Traffic routed to read-only DNs can satisfy consistent read requirements. You can read the latest committed data. FALSE: The data freshness of reads from read-only DNs depends on the synchronization latency between the primary and replica instances. |
SUPPORT_INSTANT_ADD_COLUMN | No | OFF | [ON|OFF] | Enables or disables the instant add column feature. Enable this feature using the |
ENABLE_STATEMENTS_SUMMARY | No | true | [true|false] | Enables or disables SQL statement aggregation. |
STATEMENTS_SUMMARY_PERCENT | No | 1 | [0-100] | The percentage of SQL statements to aggregate. |