All Products
Search
Document Center

PolarDB:Parameter configuration

Last Updated:Oct 21, 2025

This topic provides a detailed reference for the kernel parameters available in PolarDB for MySQL. You can find parameters organized by their corresponding features.

Note

For compatibility with MySQL configuration files, some cluster parameters in the PolarDB console are prefixed with loose_.

General parameters

Parameter name

Scope

Description

implicit_primary_key

Global

Controls whether to automatically generate an implicit primary key when a table is created without one. Valid values:

  • ON: Automatically adds an implicit primary key.

  • OFF: Does not add an implicit primary key.

Note
  • When sets to ON, an implicit primary key is added, which has a small storage overhead. To disable this behavior, contact technical support.

  • To view the current value of this parameter, run the SHOW GLOBAL VARIABLES LIKE 'xxx'; command.

In-Memory Column Index (IMCI) parameters

Parameter name

Scope

Description

loose_allow_implicit_imci_alter_comment

Session

Specifies an IMCI can be created by modifying table-level comments. Valid values:

  • ON (default): Creates an IMCI by modifying comments.

  • OFF: Creates an IMCI without modifying comments.

loose_imci_enable_pack_order_key

Global/Session

Controls the data sorting feature when creating an IMCI. Valid values:

  • ON (default): Enables data sorting.

  • OFF: Disables data sorting.

loose_imci_enable_pack_order_key_changed_rebuild

Global

Specifies whether to rebuild the table when the sort order of the IMCI changes. Valid values:

  • ON: The table needs to be rebuilt when the Order Key of IMCI changes.

  • OFF (default): The table does not need to be rebuilt when the Order Key of IMCI changes.

loose_imci_parallel_build_threads_per_table

Global

The number of threads for a single table when setting the sort key for an IMCI.

Valid values: 1 to 128. Default value: 8.

loose_imci_optimizer_switch

Global/Session

Specifies whether to Use hybrid plans to accelerate wide table queries that meet the conditions. Valid values:

  • 'force_hybrid_index_search=OFF' (default): Does not force the use of Hybrid Plan to accelerate wide table queries (automatically selected by the optimizer).

  • 'force_hybrid_index_search=ON': Forces the use of a Hybrid Plan.

Note

If the tables involved in the query statement do not have statistics information, or if the IMCI's cardinality estimation and cost calculation features are not enabled, the JOIN REORDER feature will not be enabled even if this parameter is set to ON.

loose_imci_auto_update_statistic

Global/Session

Specifies whether the join reorder for the IMCI optimizer recollects statistics information when the statistics information is outdated. Valid values:

  • ASYNC (default): IMCI optimizer asynchronously samples and recollects statistics information.

  • SYNC: IMCI optimizer synchronously samples and recollects statistics information.

  • OFF: IMCI optimizer does not recollect statistics information.

loose_imci_max_enum_join_pairs

Global

The number of equivalent execution plans that the IMCI optimizer is allowed to search when IMCI is used and join reordering is enabled.

Valid values: 0 to 4294967295. Default value: 2000.

loose_etl_from_imci

Global/Session

Specifies whether to enable the use of ETL to read data from column store. Valid values:

  • ON: Enables the feature.

  • OFF (default): Disables the feature.

  • FORCED: Cancels transaction restrictions.

loose_etl_from_imci_compress

Global/Session

Specifies whether to compress files when reading data from a read-only IMCI node. Valid values:

  • ON: Compresses files when reading data from a read-only IMCI node.

  • OFF (default): Does not compress files when reading data from a read-only IMCI node.

loose_imci_enable_hybrid_plan

Global

Controls the Hybrid Plan acceleration for wide table queries feature. Valid values:

  • ON (default): Enables the Hybrid Plan acceleration for wide table queries feature.

  • OFF: Disables the Hybrid Plan acceleration.

loose_imci_enable_window_function

Global

Specifies whether SQL statements that contain window functions can use the In-Memory Column Index feature. Valid values:

  • 2 (default): SQL statements that contain window functions can use IMCI.

  • 1: SQL statements that contain window functions without specifying FRAME can use IMCI.

  • 0: SQL statements that contain window functions cannot use IMCI.

loose_imci_min_virtual_memory

Global

The minimum memory required for queries using the column store index.

Valid values: 1 to 9223372036854775807. Default value: DBNodeClassMemory*3/20. Unit: Byte.

loose_imci_max_virtual_memory

Global

The maximum memory allowed for queries using the column store index.

Valid values: 1 to 9223372036854775807. Default value: 9223372036854775807. Unit: Byte.

loose_imci_ap_threshold

Global/Session

The threshold that determines whether SQL statements are distributed to IMCI nodes.

Valid values: 1 to 18446744073709551615. Default value: 50000.

Note

When automatic routing between column store and row store is enabled, if the estimated execution cost of an SQL statement exceeds 50000, the statement is routed to an IMCI node.

loose_cost_threshold_for_imci

Session

The estimated execution cost threshold for the current SQL statement within the IMCI nodeIMCI-related parameters.

Valid values: 1 to 18446744073709551615. Default value: 50000.

Note

When automatic routing between column store and row store is enabled, if the estimated execution cost of an SQL statement exceeds 50000, a column store execution plan is selected. Otherwise, a row store execution plan is used.

loose_imci_enable_query_trace

Global

Controls whether to print kernel error logs during the query optimization process of column store index. Valid values:

  • ON: Prints kernel error logs during the query optimization process of column store index.

  • OFF (default): Does not print kernel error logs during the query optimization process of column store index.

loose_polar_enable_implicit_imci_with_create_table

Global

Specifies whether to add full table coverage column indexes to all new tables. Valid values:

  • ON: Adds full table coverage column indexes to all new tables.

  • OFF (default): Does not add full table coverage column indexes to all new tables.

loose_imci_columnar_advise_buffer_size

Global

Sets the available memory size for the dbms_imci.columnar_advise(); stored procedure.

Valid values: 0 to 18446744073709551615. Default value: 8388608. Unit: Byte.

loose_imci_default_pack_shift

Global

Sets the row group size of the column store index.

Valid values: 7 to 18. Default value: 14.

Note

For PolarDB for MySQL 8.0.1 with minor version 8.0.1.1.36 or earlier, the default value of this parameter is 16.

loose_slow_log_record_imci

Global

Specifies whether to add information related to column store index to slow logs. Valid values:

  • ON: Adds information related to column store index to slow logs.

  • OFF (default): Does not add information related to column store index to slow logs.

loose_imci_default_write_policy

Global

Sets the write policy for column store index data. Valid values:

  • Tradeoff (default): Optimizes based on Skip4K. When less than 1 MB data needs to be written, it is equivalent to ForPerformance. When 1 MB or more data needs to be written, try to split the data into multiple files.

  • ForCapacity: Prioritizes storage space by splitting data across multiple files as much as possible to minimize internal fragmentation. Each write operation generates at most one 4 KB internal fragment.

  • ForPerformance: Prioritizes performance by selecting a file with the most suitable ExtentSize for each write operation. This policy ensures the best I/O performance, but results in the maximum fragmentation percentage and high space waste.

  • Skip4K: The data splitting logic is similar to ForCapacity. When more than 4 KB data is to be written, the 4 KB extent is ignored. A maximum of one fragment of 16 KB is generated in each write.

Elastic parallel queries (EPQ) parameters

Parameter name

Scope

Description

loose_max_parallel_degree

Global/Session

The maximum degree of parallelism for a single query, which is the maximum number of Workers for parallel execution.

Valid values: 0 to 1024. Default value: 0. This value specifies that the elastic parallel query feature is disabled.

Note
  • The PolarDB optimizer may execute the main query and subqueries in parallel separately. If they are executed in parallel simultaneously, their maximum number of Workers cannot exceed the value of loose_max_parallel_degree. The total number of Workers used for the entire query is the sum of the Workers used for the main query and subqueries.

  • The relationship between the parallel query settings in the console and the loose_max_parallel_degree parameter is as follows:

    • If both the console and the system parameter loose_max_parallel_degree are configured, the console configuration takes precedence. Therefore, we recommend that you use the console to enable parallel queries.

    • If parallel query is not enabled in the console, but the system parameter loose_max_parallel_degree is set to a value greater than 0, single-node parallelism is enabled by default.

loose_max_parallel_workers

Global

The maximum number of parallel worker threads allowed to run simultaneously. When this value is exceeded, parallel queries need to enter the task queue and wait.

Valid values: 1 to 10000. Default value: twice the number of CPU cores.

Note
  • The loose_max_parallel_workers parameter in serverless clusters is adjusted according to the elastic scaling of node specifications.

  • For more information about parallel query queuing strategies, see Parallel resource control strategy configuration.

loose_queuing_parallel_degree_limit

Global

The maximum sum of DOP values for parallel queries that can enter the queue at a time. If the specified value is exceeded, parallel queries are prohibited and sequential execution is used.

Valid values: 0 to 10000. Default value: 64.

loose_pq_max_queuing_time

Global/Session

The maximum waiting time for parallel queries in the queue. If the waiting time exceeds this value, the query falls back to sequential execution.

Valid values: 0 to 18446744073709551615. Default value: 200. Unit: milliseconds.

loose_parallel_degree_policy

Global

Sets the parallel degree configuration policy for a single query. Valid values:

  • TYPICAL: PolarDB does not consider database load (such as CPU usage) when selecting the query parallelism, and tries to maintain consistency with the parallelism set by loose_max_parallel_degree.

  • AUTO: PolarDB decides whether to prohibit parallel query plans based on database load (such as CPU usage), and selects the degree of parallelism based on query cost.

  • REPLICA_AUTO (default): Only read-only nodes decide whether to prohibit parallel query plans based on database load (such as CPU usage) and select the degree of parallelism based on query cost, while the primary node does not enable parallel queries.

Note

For more information about parallel degree configuration policies, see Parallel resource control strategy configuration.

loose_records_threshold_for_parallelism

Session

If the optimizer estimates that a table in the statement has a scan record count exceeding this threshold, the optimizer considers selecting a parallel execution plan.

Valid values: 0 to 18446744073709551615. Default value: 10000.

Note

If your business volume is small or the concurrency of complex query business is low, choose to set this threshold to 2000 or above.

loose_cost_threshold_for_parallelism

If the optimizer estimates that the sequential execution cost of a query exceeds this threshold, the optimizer considers selecting a parallel execution plan.

Valid values: 0 to 18446744073709551615. Default value: 50000.

loose_records_threshold_for_mpp

If the number of scanned rows of a table involved in a query statement exceeds this threshold, the optimizer considers using multi-node parallel execution.

Valid values: 0 to 18446744073709551615. Default: 0, which means Automatically Taking N Times The Value Of Loose_records_threshold_for_parallelism, Where N Is The Number Of Nodes In The EPQ Cluster.

loose_cost_threshold_for_mpp

If the sequential execution cost of a query statement exceeds this threshold, the optimizer considers using multi-node parallel execution.

Valid values: 0 to 18446744073709551615. Default value: 0, which means Automatically Taking N Times The Value Of Loose_cost_threshold_for_parallelism, Where N Is The Number Of Nodes.

loose_auto_dop_cpu_pct_hwm

Global

The CPU usage threshold. If CPU usage exceeds this threshold, PolarDB prohibits parallel query plans.

Valid values: 0 to 100. Default value: 70.

loose_auto_dop_mem_pct_hwm

The memory usage threshold. If memory usage exceeds this threshold, PolarDB prohibits parallel query plans.

Valid values: 0 to 100. Default value: 90.

loose_auto_dop_iops_pct_hwm

The IOPS usage threshold. If IOPS usage exceeds this threshold, PolarDB prohibits parallel query plans.

Valid values: 0 to 100. Default value: 80.

Query optimization parameters

Parameter name

Scope

Description

loose_polar_optimizer_switch

Global/Session

Only enables or disables the subquery folding feature. By default, subqueries are not merged.

Valid values:

  • coalesce_subquery=ON: Enables the subquery folding feature.

  • coalesce_subquery=OFF: Disables the subquery folding feature.

Global/Session

Query optimization control switch. Valid values:

  • 'having_cond_pushdown=ON' (default): Enables the condition pushdown (HAVING to WHERE) feature.

  • 'having_cond_pushdown=OFF': Disables the condition pushdown (HAVING to WHERE) feature.

Global/Session

The join condition pushdown switch. Valid values:

  • 'join_predicate_pushdown=ON' (default): Enables the join condition pushdown feature.

  • 'join_predicate_pushdown=OFF': Disables the join condition pushdown feature.

loose_in_predicate_conversion_threshold

Global

Controls the IN predicate to JOIN conversion feature.

When the number of elements in the IN list of an SQL statement is greater than or equal to this parameter value, the SQL statement is converted, and the IN predicate is converted to JOIN.

Valid values: 0 to 999999. Default value: 5000.

Note

If this parameter is set to 0, the feature is disabled.

loose_join_elimination_mode

Global

Controls the left join elimination feature. Valid values:

  • REPLICA_ON (default): Enables the left join elimination feature only on read-only nodes.

  • ON: Enables the left join elimination feature.

  • OFF: Disables the left join elimination feature.

loose_join_predicate_pushdown_opt_mode

Global

Controls on which nodes to enable the join condition pushdown feature. Valid values:

  • REPLICA_ON (default): Enables the join condition pushdown feature only on read-only nodes.

  • ON: Enables the join condition pushdown feature on all nodes.

  • OFF: Disables the join condition pushdown feature on all nodes.

loose_having_cond_pushdown_mode

Global

Controls on which nodes to enable the condition pushdown (HAVING to WHERE) feature. Valid values:

  • REPLICA_ON (default): Enables the condition pushdown (HAVING to WHERE clause) feature only on read-only nodes.

  • ON: Enables the condition pushdown (HAVING to WHERE clause) feature on all nodes.

  • OFF: Disables the condition pushdown (HAVING to WHERE clause) feature on all nodes.

loose_derived_cond_pushdown_mode

Global

Controls the condition pushdown (WHERE condition to derived table) switch. Valid values:

  • OFF: Disables the condition pushdown (WHERE to Derived Tables) feature.

  • ON: Enables the condition pushdown (WHERE to Derived Tables) feature.

  • REPLICA_ON (default): Enables the condition pushdown (WHERE to Derived Tables) feature only on read-only nodes.

loose_subquery_cond_pushdown_mode

Global

Controls the condition pushdown (WHERE clause to IN subquery) feature. Valid values:

  • REPLICA_ON: Enables this condition pushdown feature only on read-only nodes.

  • ON: Enables this condition pushdown feature.

  • OFF (default): Disables this condition pushdown feature.

loose_join_cond_push_into_derived_mode

Global

Controls the condition pushdown (join condition to materialized derived table) feature. Valid values:

  • REPLICA_ON (default): Enables this condition pushdown feature only on read-only nodes.

  • ON: Enables this condition pushdown feature.

  • OFF: Disables this condition pushdown feature.

loose_predicate_deduce_mode

Global

Controls the transitive predicate generation (enhanced condition pushdown) feature. Valid values:

  • REPLICA_ON: Enables the transitive predicate generation feature only on read-only nodes.

  • ON: Enables the transitive predicate generation feature.

  • OFF (default): Disables the transitive predicate generation feature.

loose_plan_cache_type

Session

The auto plan cache mode. Valid values:

  • OFF (default): Disables the Auto Plan Cache feature.

  • AUTO: Automatically caches the execution plans of SQL statements that meet the cache conditions in the Plan Cache.

    Note

    Cache conditions:

    If the overall execution time of an SQL statement is greater than or equal to the value of the loose_auto_plan_cache_time_threshold parameter, and the percentage of optimization time in the overall execution time is greater than or equal to the value of the loose_auto_plan_cache_pct_threshold parameter, the execution plan of the SQL statement is cached in the Plan Cache.

  • DEMAND: Caches the execution plans of specified SQL statements in the Plan Cache.

  • ENFORCE: Forces the caching of execution plans for all SQL statements in the Plan Cache.

loose_plan_cache_expire_time

Session

If an execution plan in the auto plan cache is not hit for this period of time, the memory is reclaimed. Unit: seconds.

Valid values: 0 to 4294967295. Default value: 1800.

loose_auto_plan_cache_pct_threshold

Session

The specified ratio of the optimization time of a SQL statement to the overall execution time.

Valid values: 0 to 100. Default value: 20.

loose_auto_plan_cache_time_threshold

Session

The upper limit of the total execution time of an SQL statement. Unit: microseconds.

Valid values: 0 to 18446744073709551615. Default value: 400.

loose_auto_plan_cache_count_threshold

Session

When the loose_plan_cache_type parameter is set to AUTO, this parameter specifies the threshold for the number of times the execution plans of SQL statements that meet the cache conditions are cached in the Plan Cache.

Valid values: 0 to 18446744073709551615. Default value: 512.

Note

The execution plan in the cache takes effect only when the number of times it is cached in the Plan Cache is greater than or equal to the value of the loose_auto_plan_cache_count_threshold parameter.

loose_adaptive_plans_switch

Global/Session

Controls the adaptive execution plan switching feature. Valid values:

  • imci_chosen: Controls whether to use adaptive execution in row and column routing.

    • ON (default): Enables adaptive execution in row and column routing, but the IMCI node still needs to be correctly configured for this to take effect.

    • OFF: Prohibits adaptive execution in row and column routing.

  • ordering_index: Controls whether to use adaptive selection of ordered indexes in row and column routing.

    • ON: Enables the adaptive adjustment of ordered index selection.

    • OFF (default): Prohibits adaptive adjustment of ordered index selection results.

loose_adaptive_cost_threshold_for_imci

Global/Session

Sets the cost threshold for row and column adaptive execution plan switching distribution.

Valid values: 1 to 18446744073709551615. Default value: 50000.

Note

This parameter is supported for the following database engine versions:

  • PolarDB for MySQL 8.0.1 with revision version 8.0.1.1.49 or later.

  • PolarDB for MySQL 8.0.2 with revision version 8.0.2.2.29 or later.

loose_adaptive_plans_max_time

Global/Session

The maximum execution time allowed for an SQL statement to switch adaptive execution plans. If the execution time of an SQL statement exceeds the value, the execution plan is not switched even if the threshold for execution plan switching is reached.

Valid values: 0 to 1800000. Default value: 500. Unit: milliseconds.

loose_adaptive_ordering_rows_threshold

Global/Session

Sets the checkpoint for adaptive selection of ordered indexes. The smaller the valid index value, the earlier the adaptive check and adjustment will be performed.

Valid values: 0 to 4294967295. Default value: 50000.

loose_optimizer_switch

Global/Session

The main control switch for Limit Offset pushdown. Variables related to the LIMIT OFFSET pushdown feature:

  • limit_offset_pushdown: The Limit Offset pushdown optimization switch.

    • ON (default): Enables the Limit Offset pushdown optimization switch.

    • OFF: Disables the Limit Offset pushdown optimization switch.

  • detach_range_condition: The full predicate pushdown optimization switch.

    • ON (default): Enables the full predicate pushdown optimization switch.

    • OFF: Disables the full predicate pushdown optimization switch.

loose_bloom_filter_enabled

Global/Session

The Bloom Filter optimization switch. Valid values:

  • ON (default): Enables the Bloom Filter optimization switch.

  • OFF: Disables the Bloom Filter optimization switch.

DDL optimization parameters

Parameter name

Scope

Description

loose_innodb_support_instant_add_column

Global

The switch for the instantly add column feature. Valid values:

  • ON: Enables the instantly add column feature.

  • OFF (default): Disables the instantly add column feature.

Note

This parameter is supported for the following database engine versions:

  • The instantly add column feature for PolarDB for MySQL 5.6 is in the canary release. To use this feature, go to the Quota Center, find the quota name based on the quota ID polardb_mysql_iac_56, and click Apply in the corresponding operation column to enable this feature.

  • For PolarDB for MySQL 5.7 with revision version 5.7.1.0.6 or later, enable the loose_innodb_support_instant_add_column parameter to use this feature on PolarDB for MySQL 5.7 clusters.

  • For PolarDB for MySQL 8.0, use the instantly add column feature directly without configuring this parameter.

loose_innodb_polar_instant_modify_column_enable

Global

Controls the instantly modify column feature. Valid values:

  • ON: Enables the instantly modify column feature.

  • OFF (default): Disables the instantly modify column feature.

Note

The PolarDB for MySQL instantly modify column feature is in the canary release. To use this feature, go to the Quota Center, find the quota name based on the quota ID polarm_82_instant_modify_column, and click Apply in the corresponding operation column to enable this feature.

loose_innodb_polar_instant_modify_column_max_times

Global

Sets the maximum number of instantly modify column operations allowed for a single table.

Valid values: 1 to 64. Default value: 16.

loose_innodb_support_instant_modify_charset

Global

Controls the instantly change a column character set feature. Valid values:

  • OFF (default): Disables the instantly change a column character set feature.

  • ON: Enables the instantly change a column character set feature.

Note

Depending on your database engine versions:

  • For PolarDB for MySQL 8.0.1 with revision version 8.0.1.1.40 or later, configure the loose_innodb_support_instant_modify_charset parameter to use this feature.

  • For PolarDB for MySQL 8.0.2, it's supported by default. No need to configure any parameters.

loose_innodb_polar_parallel_ddl_threads

Session

Controls the number of parallel threads for each DDL operation. Valid values: 1 to 16. Default value: 1, which means executing single-threaded DDL.

If the value of this parameter is not 1 when you create secondary indexes, the parallel DDL feature is automatically enabled.

Note

If the value of this parameter is 1, the system uses two concurrent threads by default.

innodb_parallel_build_primary_index

Global

Controls whether to allow the use of the parallel DDL feature when creating primary key indexes. Valid values:

  • ON: Allows the use of the parallel DDL feature when creating primary key indexes.

  • OFF (default): Does not allow the use of the parallel DDL feature when creating primary key indexes.

Note

This parameter is in the canary release. To use it, go to the Quota Center, find Quota Name as PolarDB Parallel Primary Key Creation Trial Whitelist, and click Apply in the Operation column to apply for a trial.

loose_innodb_polar_use_sample_sort

Session

The sample sort optimization feature switch. Valid values:

  • ON: Enables the sample sort optimization feature switch.

  • OFF (default): Disables the sample sort optimization feature switch.

loose_innodb_polar_use_parallel_bulk_load

Session

The parallel bulk load optimization feature switch. Valid values:

  • ON: Enables the parallel bulk load optimization feature switch.

  • OFF (default): Disables the parallel bulk load optimization feature switch.

loose_innodb_polar_ddl_build_index_readahead

Global

The DDL readahead feature switch. Valid values:

  • ON: Enables the DDL readahead feature.

  • OFF (default): Disables the DDL readahead feature.

loose_innodb_polar_ddl_build_index_readahead_page_num

Global

The number of pages for DDL readahead. The size of a page is 16 KB.

Valid values: 32 to 256. Default value: 64.

loose_innodb_polar_ddl_async_io

Global

The DDL asynchronous I/O feature switch. Valid values:

  • ON: Enables the DDL asynchronous I/O feature.

  • OFF (default): Disables the DDL asynchronous I/O feature.

loose_innodb_polar_parallel_merge_ways

Session

The number of ways for merge sort.

Valid values: 2 to 16. Default value: 2. This value indicates that the database uses two-way merge sort by default. If you specify a value greater than 2, the multi-way merge sort feature is enabled.

loose_innodb_flush_pages_using_space_id

Global

The Faster TRUNCATE/DROP TABLE feature switch. Valid values:

  • ON (default): Enables the Faster TRUNCATE/DROP TABLE feature.

  • OFF: Disables the Faster TRUNCATE/DROP TABLE feature.

Note

PolarDB for MySQL clusters must run version 5.7 with minor version 5.7.1.0.21 or later.

loose_polar_nonblock_ddl_mode

Session

The Nonblock DDL feature switch. Valid values:

  • ON: Enables the Nonblock DDL feature.

  • OFF (default): Disables the Nonblock DDL feature.

loose_polar_nonblock_ddl_retry_times

Session

Sets the number of retry attempts when obtaining a MDL-X lock times out. Valid values: 0 to 31536000. Default value: 0 (the value calculated from the lock_wait_timeout parameter).

Note

We recommend that you set the value of this parameter to 4194304.

loose_polar_nonblock_ddl_retry_interval

Session

Sets the time interval for retrying to obtain a MDL-X lock after a timeout.

Valid values: 0 to 31536000. Unit: seconds. Default value: 6.

loose_polar_nonblock_ddl_lock_wait_timeout

Session

Sets the timeout period for obtaining a MDL-X lock.

Valid values: 1 to 31536000. Unit: seconds. Default value: 1.

loose_innodb_bulk_load_page_grained_redo_enable

Global

The DDL physical replication optimization feature switch. Valid values:

  • ON: Enables DDL physical replication optimization.

  • OFF (default): Disables DDL physical replication optimization.

loose_polar_support_mdl_sync_preemption

Session

The preemptive DDL feature switch. Valid values:

  • ON: Enables the preemptive DDL feature.

  • OFF (default): Disables the preemptive DDL feature.

loose_polar_mdl_sync_preempt_after_wait_second

Global

Sets the timeout period for synchronizing MDL locks when they are blocked. If the MDL lock is not synchronized when the specified timeout period ends, a preemption thread is initiated.

Valid values: 1 to 31536000. Default value: 10.

loose_polar_enable_explain_ddl

Global

The EXPLAIN DDL feature switch. Valid values:

  • ON (default): Enables the EXPLAIN DDL feature.

  • OFF: Disables the EXPLAIN DDL feature.

loose_polar_max_collect_thd_num_in_explain_ddl

Global

Controls the number of potential MDL blocking threads to collect.

Valid values: 1 to 512. Default value: 16.

loose_polar_performance_schema

Global

Controls whether to enable the Polar Performance Schema feature. Valid values:

  • ON: Enables Polar Performance Schema.

  • OFF: Disables Polar Performance Schema.

Note

You need to set the loose_polar_performance_schema parameter to ON in the console. You must restart the cluster for this parameter to take effect.

performance_schema_max_thread_instances

Global

Configures the maximum number of threads that Polar Performance Schema can monitor. Valid values: -1 to 65536. A value of -1 indicates that the number of threads is automatically adjusted to adapt to business changes.

Note

This parameter is tuned. We recommend that you do not modify this parameter.

performance_schema_max_metadata_locks

Global

Configures the maximum number of MDLs that Polar Performance Schema can monitor. Valid values: -1 to 1048576. A value of -1 indicates that the number of MDLs is automatically adjusted to adapt to business changes.

Note

This parameter is tuned. We recommend that you do not modify this parameter.

loose_recycle_bin

Global/Session

The table recycle bin feature switch. Valid values:

  • ON: Enables the table recycle bin feature switch.

  • OFF (default): Disables the table recycle bin feature switch.

loose_recycle_scheduler

Global

The asynchronous cleanup task thread switch for the recycle bin. Valid values:

  • ON: Enables the asynchronous cleanup task thread switch for the recycle bin.

  • OFF (default): Disables the asynchronous cleanup task thread switch for the recycle bin.

loose_recycle_bin_retention

Global

The maximum retention period for data in the recycle bin. Valid values: 86400 to 1209600 (14 days). Unit: seconds. Default value: 604800 (7 days).

Important

The status of the recycle bin cleanup task thread is as follows:

  • When loose_recycle_scheduler=ON, data in the table recycle bin is automatically cleaned up based on the retention period set by loose_recycle_bin_retention (default value: 7 days).

  • When loose_recycle_scheduler=OFF, data in the table recycle bin is retained for a long time and is not automatically cleaned up.

Binary log management parameters

Parameter name

Scope

Description

loose_enable_large_trx_optimization

Global

Enables or disables the binary logging large transaction optimization mechanism. Valid values:

  • OFF (default): Disables the binary logging large transaction optimization mechanism.

  • ON: Enables the binary logging large transaction optimization mechanism.

Note

Changes to this parameter take effect immediately without the need to restart the cluster.

loose_binlog_large_trx_threshold_up

Global

The threshold for binary logging large transaction optimization. After optimized binary log writing for large transactions is enabled, optimized binary log writing is triggered when the size of binary logs generated by a transaction exceeds the threshold.

Valid values: 10 MB to 300 GB. Default value: 1 GB.

Note

Changes to this parameter take effect immediately without the need to restart the cluster.

High concurrency optimization

Parameter name

Scope

Description

loose_ccl_mode

Global

The behavior of SQL statements when the concurrency limit is exceeded. Valid values:

  • WAIT (default): The SQL statement waits in a queue until other SQL statements are executed.

  • REFUSE: An error is returned.

Note

Only PolarDB for MySQL 8.0 supports this parameter. For PolarDB for MySQL 5.6 and 5.7 clusters, the SQL statement waits when the maximum number of concurrent threads is reached.

loose_ccl_max_waiting_count

Global

When the loose_ccl_mode parameter is set to WAIT, this parameter specifies the maximum number of SQL statements that match a single CCL rule and can wait in the queue. If this value is exceeded, an error is returned.

Valid values: 0 to 65536. Default value: 0.

Note

Only PolarDB for MySQL 5.7 and 8.0 support this parameter.

loose_hotspot

Global

The main switch for the hot row optimization feature. Valid values:

  • ON: Enables the feature.

  • OFF (default): Disables the feature.

loose_thread_pool_enabled

Global

Specifies whether to enable the thread pool feature. Valid values:

  • ON: Enables the feature.

  • OFF (default): Disables the feature.

Note
  • The default value of this parameter varies by version.

    • PolarDB for MySQL 5.6. Default value: OFF.

    • PolarDB for MySQL 5.7 and 8.0. Default value: ON.

  • You do not need to restart the cluster to enable or disable the thread pool feature.

loose_thread_pool_size

Global

The number of thread groups in the thread pool. The valid values vary based on the number of CPU cores in the primary node.

Valid values: DBNodeClassCPU to DBNodeClassCPU*10. Default value: DBNodeClassCPU*2.

Note
  • DBNodeClassCPU represents the number of CPU cores in the primary node. The value is an integer.

  • For database engine MySQL 5.7, the default value is DBNodeClassCPU.

Examples:

  • For a database engine MySQL 8.0.1 cluster edition with a primary node of 4 cores and 8 GB, the valid values range from 4 to 40, and the default value is 8.

  • For a database engine MySQL 8.0.1 Multi-master Cluster (Database/Table) with two primary nodes of 4 cores and 8 GB each, the valid values range from 8 to 80, and the default value is 16.

  • For a database engine MySQL 5.7 cluster edition with a primary node of 4 cores and 8 GB, the valid values range from 4 to 40, and the default value is 4.

loose_thread_pool_high_prio_mode

Global

The high-priority queue mode for the thread pool.

Valid values:

  • transactions (default): SQL statements with transactions are added to the high-priority queue and assigned tickets specified by thread_pool_high_prio_tickets. Subsequent SQL statements are added to the high-priority queue until the tickets are used up.

  • statements: All SQL statements are added to the high-priority queue.

  • none: No SQL statements are added to the high-priority queue.

Note

Only PolarDB for MySQL 5.6 and 5.7 support this parameter.

loose_thread_pool_high_prio_tickets

Global

The maximum number of tickets for the queue with a high priority.

Valid values: 0 to 4294967295. Default value: 4294967295.

Note

Only PolarDB for MySQL 5.6 and 5.7 support this parameter.

loose_thread_pool_idle_timeout

Global

The time threshold for releasing idle threads in the thread pool. Idle threads that have not served any requests for longer than this threshold are released.

Valid values: 0 to 31536000. Default value: 60. Unit: seconds.

Note

Only PolarDB for MySQL 5.6 and 5.7 support this parameter.

loose_thread_pool_oversubscribe

Global

The maximum number of active threads allowed in each thread group.

Valid values: 1 to 1000. Default value: 20.

An active thread is a thread that is executing a SQL statement. A thread is not active if the statement that the thread is executing is in the following status:

  • The SQL statement is pending for disk input/output (I/O).

  • The SQL statement is pending for transactions to be committed.

loose_thread_pool_stall_limit

Global

The time threshold for determining whether the thread pool enters the congested state.

When the thread pool enters the congested state, the system creates new threads to execute SQL statements.

Valid values: 1 to 18446744073709551615. Default value: 10. Unit: milliseconds.

Note

For database engine MySQL 5.6, the default value is 30 milliseconds.

loose_bypass_thread_pool_ips

Global

Client IP addresses that are not blocked by the thread pool. Even if the thread pool is full, SQL statements from these IP addresses can be executed for management operations.

Sample configurations:

10.69.96.16,10.69.96.17
Note

Only PolarDB for MySQL 8.0.1 with minor version 8.0.1.1.19 supports this parameter.

loose_bypass_thread_pool_check_ignore_proxy

Global

Database accounts with a high priority. Requests from these accounts are placed in the high-priority queue of the thread pool for priority processing.

Sample configurations:

user1, user2
Note
  • Only PolarDB for MySQL 8.0.1 with minor version 8.0.1.1.19 supports this parameter.

  • After you configure this parameter, it takes effect only for new database connections.

  • We recommend that you configure a minimal number of high-priority accounts.

loose_thread_pool_high_priority_users

Global

The timeout threshold for DDL operations in the thread pool. When the threshold is reached, the DDL statements are marked as timeout, and the system automatically creates a new thread to execute the statements.

Valid values: 0 to 864000. Default value: 600. Unit: seconds.

Note

Only PolarDB for MySQL 8.0.1 with minor version 8.0.1.1.19 supports this parameter.

loose_thread_pool_mark_ddl_thread_timeout_sec

Global

The timeout threshold for DDL operations in the thread pool. When the threshold is reached, the DDL operation is labeled as timed out, and the system automatically creates a new thread to execute the operation.

Valid values: 0 to 864000. Default value: 600. Unit: seconds.

Note

Only PolarDB for MySQL 8.0.1 with minor version 8.0.1.1.19 supports this parameter.

loose_thread_pool_mark_ddl_thread_timeout_immediately

Global

Specifies whether to immediately mark DDL operations as timeout when the thread pool is under high load and the low-priority queue is stacked. In this case, the system creates a new thread to execute the request. This parameter is applicable to scenarios where many DDL statements are executed.

Valid values:

  • ON: Enables the feature.

  • OFF (default): Disables the feature.

Note

Only PolarDB for MySQL 8.0.1 with minor version 8.0.1.1.19 supports this parameter.

loose_innodb_polar_blink_tree

Global

Controls the B-tree concurrency control optimization mechanism. Valid values:

  • OFF (default): Disables the B-tree concurrency control optimization mechanism.

  • ON: Enables the B-tree concurrency control optimization mechanism.

Partitioned table parameters

Parameter

Scope

Description

loose_partition_level_mdl_enabled

Global

The online partition maintenance feature switch. Valid values:

  • ON: Enables the PARTITION Level MDL feature.

  • OFF: Disables the PARTITION Level MDL feature.

Note

You must restart the cluster to validate the modification.

loose_hybrid_partition_query_mix_engine_enabled

Global

Specifies whether to query partition data in non-InnoDB engines when querying hybrid partitioned tables. Valid values:

  • ON (default): Queries partition data in non-InnoDB engines.

  • OFF: Does not query partition data in non-InnoDB engines.

Flashback query parameters

Parameter

Scope

Description

loose_innodb_backquery_enable

Global

Enables or disables the flashback query feature. Valid values:

  • ON: Enables the feature.

  • OFF: Disables the feature (default).

Note
  • The flashback query feature requires the innodb_backquery_enable parameter to be enabled. This parameter is disabled by default. Before you use this feature, enable the innodb_backquery_enable parameter in the Parameter Configuration of your PolarDB cluster.

  • If you execute a flashback query before enabling the innodb_backquery_enable parameter, the system returns the error ERROR 1815 (HY000): Internal error: the backquery_time set is out of range, too old.

loose_innodb_backquery_window

Global

The time duration supported by flashback queries.

Valid values: 1 to 604800. Default value: 86400. Unit: seconds.

loose_innodb_backquery_capacity_limit

Global

The undo log capacity supported by flashback queries. When the undo log capacity is greater than or equal to this value, the time duration supported by flashback queries is shortened.

Valid values: 100 to 200000000. Default value: 100000000. Unit: MB.

Cold data archiving parameters

Parameter

Scope

Description

loose_csv_oss_buff_size

Session

The memory size occupied by a single OSS thread. Default value: 134217728. Unit: Byte.

Valid values: 4096 to 134217728.

loose_csv_max_oss_threads

Global

The number of OSS threads allowed to run currently.

Valid values: 1 to 100. Default value: 1. Unit: threads.

loose_max_oss_outfile_threads

Session

The number of OSS OUTFILE threads that PolarDB can start simultaneously. Valid values: 1 to 100. Default value: 1. Unit: threads.

Use the SHOW STATUS LIKE "oss_outfile_threads_running"; command to view the number of OSS OUTFILE threads that are currently running in the cluster.

Note

For clusters running PolarDB for MySQL 8.0.1.1.38 or later, this parameter is invalid.

loose_oss_outfile_buffer_size

Global

The memory size that a single OSS OUTFILE thread can use. In most cases, the export speed increases if a thread can use more memory.

Valid values: 102400 to 536870912. Default value: 134217728. Unit: Byte.

Data cleanup parameters

Parameter name

Scope

Description

loose_innodb_enable_ttl_purge

Global

Specifies whether to enable the time to live (TTL) feature.

Valid values:

  • OFF (default): Disables the feature.

  • ON: Enables the feature.

loose_innodb_ttl_min_interval

Global

The minimum TTL value.

Valid values: 0 to 4294967295. Default value: 100. Default unit: seconds.

loose_innodb_ttl_purge_thread

Global

The number of threads for purging expired data in data cleanup (TTL). After modification, reset the innodb_enable_ttl_purge parameter for the change to take effect.

Valid values: 2 to 32. Default value: 4. Unit: threads.

loose_innodb_ttl_cluster_index_purge_batch_size

Global

The number of primary keys scanned during data cleanup (TTL).

Valid values: 10000 to 1000000. Default value: 10000. Unit: keys.

loose_innodb_ttl_index_purge_batch_size

Global

The data scanned from the TTL column index during data cleanup (TTL).

Valid values: 500 to 1000000. Default value: 500. Unit: rows.

loose_innodb_ttl_purge_start_hour

Global

The start time for data cleanup (TTL). This value must not exceed innodb_ttl_purge_end_hour.

Valid values: 0 to 23. Default value: 0. Unit: seconds.

loose_innodb_ttl_purge_end_hour

Global

The end time for data cleanup (TTL). This value must not be less than innodb_ttl_purge_start_hour.

Valid values: 0 to 23. Default value: 0. Unit: seconds.

Parameters in other features

Parameter name

Scope

Description

loose_innodb_polar_log_rdma_transfer

Global

The RDMA log transfer feature switch. Valid values:

  • ON: Enables the RDMA log transfer feature.

  • OFF (default): Disables the RDMA log transfer feature.

loose_partial_result_cache_enabled

Global/Session

The Partial Result Cache (PTRC) feature switch. Valid values:

  • ON (default): Enables the Partial Result Cache feature.

  • OFF: Disables the Partial Result Cache feature.

loose_partial_result_cache_cost_threshold

Global/Session

The cost threshold for Partial Result Cache (PTRC). PTRC is triggered only if the cost of the entire query exceeds this threshold value.

Valid values: 0 to 18446744073709551615. Default value: 10000.

loose_partial_result_cache_check_frequency

Global/Session

The frequency of triggering dynamic feedback detection for Partial Result Cache (PTRC). A detection is triggered when the cumulative number of cache misses reaches this value.

Valid values: 0 to 18446744073709551615. Default value: 200.

loose_partial_result_cache_low_hit_rate

Global/Session

The low watermark threshold for the hit rate of Partial Result Cache (PTRC). The system uses PTRC only if the estimated hit rate is higher than this value, and stops using PTRC if the actual hit rate becomes lower than this value during execution of the query.

Valid values: 0 to 100. Default value: 20.

loose_partial_result_cache_high_hit_rate

Global/Session

The high watermark threshold for the hit rate of Partial Result Cache (PTRC). If the maximum amount of memory used by PTRC is reached, and the hit rate is higher than this value, the cached results are dumped from memory to disks, and new cache is stored in disks.

Valid values: 0 to 100. Default value: 70.

loose_partial_result_cache_max_mem_size

Global/Session

The cumulative memory usage of Partial Result Cache (PTRC) in a single query. A query may have multiple PTRCs. The total memory used by multiple PTRCs cannot exceed this value.

Valid values: 0 to 18446744073709551615. Default value: 67108864. Unit: Byte.