Miscellaneous Parameters
enable_default_ustore_table
Parameter description: Specifies whether the Ustore is used by default. This parameter is valid only when enable_ustore is enabled. If this parameter is set to on, all created tables are Ustore tables by default. If this parameter is set to off, all created tables are Astore tables by default. This parameter can be set at the PDB level. In upgrade scenarios, this parameter value after upgrade is consistent with that in the source version to ensure compatibility.
Parameter type: Boolean.
Unit: none
- on: The Ustore is used by default.
- off: The Ustore is not used by default.
Default value: on. In the PDB scenario, if this parameter is not set, the global setting is inherited.
Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1.
Setting suggestion: Retain the default value.
Risks and impacts of improper settings: When using Ustore tables, you must enable the track_counts and track_activities parameters. Otherwise, space bloat may occur.
enable_ustore
Parameter description: Specifies whether to enable Ustore. If this parameter is set to on, Ustore tables can be created.
Parameter type: Boolean.
Unit: none
Value range:
- on: The Ustore is enabled.
- off: The Ustore is disabled.
Default value: on
Setting method: This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.
Setting suggestion: This parameter is used for Ustore version control. You are advised not to change the value.
Risks and impacts of improper settings: When using Ustore tables, you must enable the track_counts and track_activities parameters. Otherwise, space bloat may occur.
enable_segment_datafile_preallocate
Parameter description: Specifies whether to allocate disk space immediately during segment-page file name extension.
Parameter type: Boolean.
Unit: none
Value range:
- on: The immediate disk space allocation mode is enabled. During file expansion, fallocate is preferentially used to allocate disk space immediately. If the system does not support fallocate, the byte-by-byte zero write mode is used to apply for disk space.
- off: The immediate disk space allocation mode is disabled. In this mode, disk space is not allocated immediately when a file is expanded, and the file increases in hole mode.
Default value: on
Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.
Setting suggestion: Retain the default value.
Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.
consistency_check_module
Parameter description: Specifies the module that requires consistency check.
Parameter type: string.
Unit: none
Default value: 'off(ALL)'. That is, the verification of all modules is disabled by default.
Value range: If the module is enabled (on), consistency check is performed. If the module is disabled (off), consistency check is not performed. You can use SHOW consistency_check_module to view the status.
ALL,on(),off(INDEX)
Currently, only the INDEX module supports the verification. The INDEX module verifies the consistency between index tuples and heap table tuples during the B-tree index scan of the Astore table.
Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1.
- First, you can use SHOW consistency_check_module to check which modules support verification. The output of the verification module is as follows:
1 2 3 4 5
gaussdb=# show consistency_check_module; consistency_check_module -------------------------- ALL,on(),off(INDEX) (1 row)
- Modules that can be verified are identified by uppercase letters, and the special ID ALL is used for setting all modules. You can use on or off to specify whether to perform verification. For example, to verify the consistency between indexes and heap tables, run the following commands:
1 2 3 4 5 6 7
gaussdb=# set consistency_check_module='on(INDEX)'; SET gaussdb=# show consistency_check_module; consistency_check_module -------------------------- ALL,on(INDEX),off() (1 row)
The command output shows that the INDEX check is enabled.
- The ALL identifier can be used to quickly enable or disable the verification of all modules.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
gaussdb=# set consistency_check_module='off(ALL)'; SET gaussdb=# show consistency_check_module; consistency_check_module -------------------------- ALL,on(),off(INDEX) (1 row) gaussdb=# set consistency_check_module='on(ALL)'; SET gaussdb=# show consistency_check_module; consistency_check_module -------------------------- ALL,on(INDEX),off() (1 row)
Setting suggestion: Enable the verification of the corresponding module as required.
Risks and impacts of improper settings: If this function is enabled, consistency check is performed during SQL execution, which takes extra time or affects performance. Exercise caution when enabling this function.
reserve_space_for_nullable_atts
Parameter description: Specifies whether to reserve space for the nullable attribute of an Ustore table. This parameter can be set at the PDB level.
Parameter type: Boolean.
Unit: none
Value range:
- on: Space is reserved for the nullable attribute of an Ustore table.
- off: Space is not reserved for the nullable attribute of an Ustore table.
Default value: on. In the PDB scenario, if this parameter is not set, the global setting is inherited.
Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1.
Setting suggestion: Retain the default value.
Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.
block_size
Parameter description: Specifies the block size of the current database.
Parameter type: integer.
Unit: none
Value range: 8192
Default value: 8192
Setting method: This is a fixed INTERNAL parameter. It can be viewed but cannot be modified.
Setting suggestion: This parameter can only be viewed.
Risks and impacts of improper settings: none
segment_size
Parameter description: Specifies the segment file size of the current database.
Parameter type: integer.
Unit: 8 KB
Value range: 131072
Default value: 131072, that is, 1 GB.
Setting method: This is a fixed INTERNAL parameter. It can be viewed but cannot be modified.
Setting suggestion: This parameter can only be viewed.
Risks and impacts of improper settings: none
max_index_keys
Parameter description: Specifies the maximum number of index keys supported by the current database.
Parameter type: integer.
Unit: none
Value range: 32
Default value: 32
Setting method: This is a fixed INTERNAL parameter. It can be viewed but cannot be modified.
Setting suggestion: This parameter can only be viewed.
Risks and impacts of improper settings: none
integer_datetimes
Parameter description: Specifies whether the date and time are in the 64-bit integer format.
Parameter type: Boolean.
Unit: none
Value range:
- on: The date and time format in 64-bit integer format is supported.
- off: The date and time format in 64-bit integer format is not supported.
Default value: on
Setting method: This is a fixed INTERNAL parameter. It can be viewed but cannot be modified.
Setting suggestion: This parameter can only be viewed.
Risks and impacts of improper settings: none
lc_collate
Parameter description: Reports the string collation locale for the current database.
Parameter type: string.
Unit: none
Value range: a string
Default value: Determined by the configuration set during the database installation and deployment.
Setting method: This is a fixed INTERNAL parameter. It can be viewed but cannot be modified.
Setting suggestion: This parameter can only be viewed.
Risks and impacts of improper settings: none
lc_ctype
Parameter description: Reports the locale settings for character types and case conversion in the current database. For example, it specifies what a letter and its upper-case equivalent are.
Parameter type: string.
Unit: none
Value range: a string
Default value: Determined by the configuration set during the database installation and deployment.
Setting method: This is a fixed INTERNAL parameter. It can be viewed but cannot be modified.
Setting suggestion: This parameter can only be viewed.
Risks and impacts of improper settings: none
max_identifier_length
Parameter description: Specifies the maximum identifier length.
Parameter type: integer.
Unit: none
Value range: 63
Default value: 63
Setting method: This is a fixed INTERNAL parameter. It can be viewed but cannot be modified.
Setting suggestion: This parameter can only be viewed.
Risks and impacts of improper settings: none
server_encoding
Parameter description: Specifies the database encoding (character set).
By default, gs_initdb will initialize the setting of this parameter based on the system environment during database creation. You can also run the locale command to check the current configuration environment.
Parameter type: string.
Unit: none
Value range: a string
Default value: Determined by the system environment when the database is created.
Setting method: This is a fixed INTERNAL parameter. It can be viewed but cannot be modified.
Setting suggestion: This parameter can only be viewed.
Risks and impacts of improper settings: none
enable_upgrade_merge_lock_mode
Parameter description: If this parameter is set to on, the delta merge operation internally increases the lock level, and errors can be prevented when update and delete operations are performed at the same time. This parameter can be set at the PDB level.
Parameter type: Boolean.
Unit: none
Value range:
- on: The delta merge operation internally increases the lock level. In this way, when the DELTAMERGE operation is concurrently performed with the UPDATE or DELETE operation, one operation can be performed only after the previous one is complete.
- off: The DELTAMERGE operation is concurrently performed with the UPDATE or DELETE operation to the data in a row in the delta table of the table. In this case, errors will be reported during the later operation, and the operation will stop.
Default value: off. In the PDB scenario, if this parameter is not set, the global setting is inherited.
Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1.
Setting suggestion: Retain the default value.
Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.
basebackup_timeout
Parameter description: Specifies the timeout interval for a connection that has no read or write operations after a backup transfer is complete. This parameter can be set at the PDB level.
When the gs_basebackup tool is used for transmission and a high compression rate is specified, the transmission of the tablespace may time out (the client needs to compress the transmitted data).
Parameter type: integer.
Unit: second
Value range: 0 to 2147483647. 0 indicates that the function is disabled.
Default value: 600. In the PDB scenario, if this parameter is not set, the global setting is inherited.
Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1. For example, if the value is 600 without a unit, basebackup_timeout indicates 600s. If the value is 10min, basebackup_timeout indicates 10 minutes. The unit must be s, min, h, or d if required.
Setting suggestion: Retain the default value.
Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.
datanode_heartbeat_interval
Parameter description: Specifies the interval for sending heartbeat messages between heartbeat threads.
Parameter type: integer.
Unit: millisecond
Value range: 1000 to 60000
Default value: 1000 (that is, 1s)
Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1. For example, if the value is 1000 without a unit, datanode_heartbeat_interval indicates 1000 ms. If the value is 1s, datanode_heartbeat_interval indicates 1s. The unit must be ms, s, min, h, or d if required.
Setting suggestion: Set this parameter to a value less than or equal to the value of wal_receiver_timeout/2.
Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.
dfs_partition_directory_length
Parameter description: Specifies the maximum directory name length for the partition directory of a table partitioned by VALUE in the HDFS.
Parameter type: integer.
Unit: none
Value range: 92 to 7999
Default value: 512
Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1.
Setting suggestion: Retain the default value.
Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.
max_concurrent_autonomous_transactions
Parameter description: Specifies the maximum number of autonomous transaction connections, that is, the maximum number of concurrent autonomous transactions executed at the same time. If this parameter is set to 0, autonomous transactions cannot be executed.
Parameter type: integer.
Unit: none
Value range: 0 to 10000. The theoretical maximum value is 10000, and the actual maximum value is a dynamic value. The calculation formula is 262143 – job_queue_processes – autovacuum_max_workers – max_inner_tool_connections – max_connections – AUXILIARY_BACKENDS – AV_LAUNCHER_PROCS. The values of job_queue_processes, autovacuum_max_workers, max_inner_tool_connections, and max_connections depend on the settings of the corresponding GUC parameters. AUXILIARY_BACKENDS indicates the number of reserved auxiliary threads and is fixed at 20. AV_LAUNCHER_PROCS indicates the number of launcher threads reserved for autovacuum and is fixed at 2.
Default value: 200 (196-core CPU/1536 GB memory, 128-core CPU/1024 GB memory, 104-core CPU/1024 GB memory, 96-core CPU/1024 GB memory); 150 (96-core CPU/768 GB memory); 120 (80-core CPU/640 GB memory) 100 (64-core CPU/512 GB memory); 80 (60-core CPU/480 GB memory); 40 (32-core CPU/256 GB memory); 20 (16-core CPU/128 GB memory); 10 (8-core CPU/64 GB memory, 4-core CPU/32 GB memory, 4-core CPU/16 GB memory)
Setting method: This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.
Suggestion: Set this parameter based on actual service requirements and hardware configurations. It is recommended that this parameter be set to a value less than or equal to 1/10 of max_connections. If you only increase the value of this parameter but do not adjust the memory parameters in the same proportion, the memory may be insufficient and the error message "memory is temporarily unavailable" is displayed when the service load is heavy.
Risks and impacts of improper settings: If the value range of this parameter is changed during the upgrade and the value is changed before the commit operation, you need to change the value range to the value allowed before the upgrade if you roll back the upgrade. Otherwise, the database may fail to be started.
enable_seqscan_fusion
Parameter description: Specifies whether to enable SeqScan optimization. This parameter can be set at the PDB level.
Parameter type: Boolean.
Unit: none
Value range:
- on: SeqScan optimization is enabled.
- off: SeqScan optimization is disabled.
Default value: off. In the PDB scenario, if this parameter is not set, the global setting is inherited.
Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1.
Setting suggestion: Retain the default value.
Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.

This parameter can be used to optimize only the execution time of the SeqScan operator in the EXPLAIN ANALYZE statement.
cluster_run_mode
Parameter description: Specifies whether a DN belongs to the primary or standby database instance in the dual-database instance DR scenario. The default value is used for a single database instance.
Value type: enumerated type.
Unit: none
Value range:
- cluster_primary: primary database instance.
- cluster_standby: standby database instance.
Default value: cluster_primary
Setting method: This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.
Setting suggestion: Mark the parameter used by the standby database instance for DR. You are advised not to set the parameter.
Risks and impacts of improper settings: After the modification, the standby database instance for DR may be abnormal.
acceleration_with_compute_pool
Parameter description: Determines whether to use the computing resource pool for acceleration when an OBS is queried. (Due to specification changes, the current version no longer supports this feature. Do not use it.)
Parameter type: Boolean.
Unit: none
Value range:
- on: The query covering OBS is accelerated based on the cost when the computing resource pool is available.
- off: No query is accelerated using the computing resource pool.
Default value: off
Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1.
Setting suggestion: Retain the default value.
Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.
max_resource_package
Parameter description: Specifies the maximum number of threads that each DN can run concurrently on an acceleration database instance on the cloud.
Parameter type: integer.
Unit: none
Value range: 0 to 2147483647
Default value: 0
Setting method: This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.
Setting suggestion: Retain the default value.
Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.
enable_gpi_auto_update
Parameter description: Determines whether global indexes are updated by default in partition DDL commands. This parameter can be set at the PDB level.
Parameter type: Boolean.
Unit: none
Value range:
- on: Global indexes are updated regardless of whether the partition DDL commands contain the UPDATE GLOBAL INDEX clause.
- off: Global indexes are not updated unless the partition DDL commands contain the UPDATE GLOBAL INDEX clause.
Default value: off. In the PDB scenario, if this parameter is not set, the global setting is inherited.
Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1.
Setting suggestion: Set this parameter based on service requirements.
Risks and impacts of improper settings: If this parameter is set to off and the partition DDL does not contain the UPDATE GLOBAL INDEX clause, the global index is unavailable.
enable_gpi_fast_prune
Parameter description: Controls whether the global partitioned index (GPI) of a Ustore table removes dead tuples left by previous DDL operations during DML processing. This parameter can be set at the PDB level.
Parameter type: Boolean
Unit: none
Value range:
- on: Junk tuples generated by DDL operations are cleared not only using the AUTOVACUUM thread but also when the index page space is insufficient during DML operations.
- off: Junk tuples generated by DDL operations are cleared only using the AUTOVACUUM thread.
Default value: on. In the PDB scenario, if this parameter is not set, the global setting is inherited.
Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1.
Setting suggestion: Set this parameter based on service requirements. If the service has partitioned tables and GPIs, and there are a large number of DDL and DML operations, you are advised to enable this parameter. If the partitioned table of the service does not have GPIs or DDL operations are not performed on the partitioned table, you are advised to disable this parameter.
Risks and impacts of improper settings: If this parameter is set to off, only the autovacuum thread handles DDL garbage, which may cause the GPI to bloat.
enable_partition_autoextend_retry
Parameter description: Specifies whether to use autonomous transactions by default when new partitions are added to a partitioned table that is automatically extended. If this parameter is set to on and an exception occurs when a partition is added for an autonomous transaction, the logic of adding a partition for the same transaction is retried. This parameter can be set at the PDB level.
Parameter type: Boolean.
Unit: none
Value range:
- on: If an exception occurs when a partition is added to a partitioned table using autonomous transactions, add a partition again for the same transaction.
- off: If an exception occurs when a partition is added to a partitioned table using autonomous transactions, an exception is thrown.
Default value: on. In the PDB scenario, if this parameter is not set, the global setting is inherited.
Setting method: This is a SUSET parameter. Set it based on instructions provided in Table 1.
Setting suggestion: Retain the default value.
Risks and impacts of improper settings: If this parameter is set to off, an exception will be thrown when a new partition is added to a partitioned table using autonomous transactions.
enable_gsplsql_execopt
Parameter description: Specifies whether to optimize the execution of stored procedure functions. This parameter can be set at the PDB level.
Parameter type: Boolean.
Unit: none
Value range:
- on: The information that is not changed during the running of a stored procedure is allocated and recorded during the initialization of the stored procedure. This prevents invalid repeated calling during the execution of the stored procedure.
- off: The default calling logic is used and information is initialized in each loop.
Default value: on. In the PDB scenario, if this parameter is not set, the global setting is inherited.
Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1.
Setting suggestion: Retain the default value.
Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.
dynamic_procedure_cache_count
Parameter description: Specifies the maximum number of dynamic statements that can be cached during stored procedure execution. When the number of cached dynamic statements reaches the specified value, subsequent statements are not optimized. In the multi-tenancy scenario, this parameter can be set at the PDB level.
Parameter type: integer.
Unit: none
Value range: 0 to 1024. 0 indicates that the data is not cached.
Default value: 128. In the PDB scenario, if this parameter is not set, the global setting is inherited.
Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1.
Setting suggestion: Retain the default value.
Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.
multi_insert_min_rows
Parameter description: Specifies the minimum estimated number of rows to be inserted in batches. You can run explain (verbose on) to check whether the execution plan contains "Batch Insert." This parameter can be set at the PDB level.
Parameter type: integer.
Unit: none
Value range: –1 to 2147483647. –1 indicates that batch insertion is not used. If the value is greater than or equal to 0, the estimated number of rows to be inserted is greater than or equal to multi_insert_min_rows, and batch insertion is used for the INSERT SELECT statement to improve performance.
Default value: 1000. In the PDB scenario, if this parameter is not set, the global setting is inherited.
Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1.
Setting suggestion: Retain the default value or a value greater than 1000. If the number of inserted data rows is small, batch insertion may deteriorate the insertion performance.
Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.

- Specification
By default, the batch insertion rate of an Astore table can be improved by about 50%, and the batch insertion rate of a Ustore table can be improved by about 60%.
- Constraint
In addition to the multi_insert_min_rows parameter constraint, batch insertion has the following constraints:
- Statements other than INSERT SELECT are not supported.
- Tables that contain BEFORE and INSTEAD triggers are not supported because the data to be inserted may be changed.
- SQL statements cannot contain the volatile function because a new transaction is started each time a volatile function is executed. However, if batch insertion is used, the snapshot obtained by the volatile function may be different from that obtained by common insertion.
- The SQL statement cannot contain the RETURNING clause.
- The UPSERT clause is not supported.
- Batch insertion cannot be used for unlogged tables, temporary tables, or global temporary tables. Otherwise, the performance may deteriorate.
- Tables containing auto increment columns are supported only when b_format_version is set to '5.7' or b_format_dev_version is set to 's2'.
Example: -- Create tables and data. gaussdb=# CREATE TABLE t(id int, c1 varchar(20), c2 varchar(40), c3 varchar(50)) WITH (storage_type=astore); gaussdb=# CREATE TABLE t_tmp(id int, c1 varchar(20), c2 varchar(40), c3 varchar(50)) WITH (storage_type=astore); gaussdb=# INSERT INTO t_tmp VALUES (generate_series(1, 1000), '1111111111111111111', '222222222222222222222', '333333333333333333333333333333333'); analyze t_tmp; -- Insert 1000 rows of data for 1000 times. Batch insertion takes 1.2s while non-batch insertion takes 2.68s. Using batch insertion improves the performance by more than 50%. gaussdb=# SET multi_insert_min_rows=-1; gaussdb=# DECLARE start_time bigint; end_time bigint; BEGIN start_time := dbe_utility.get_time(); for i in 1 .. 1000 loop insert into t select * from t_tmp; end loop; end_time := dbe_utility.get_time(); dbe_output.print_line('Time consumed:' ||(end_time - start_time)/100); END; / Time consumed: 2.68 gaussdb=# SET multi_insert_min_rows=0; gaussdb=# DECLARE start_time bigint; end_time bigint; BEGIN start_time := dbe_utility.get_time(); for i in 1 .. 1000 loop insert into t select * from t_tmp; end loop; end_time := dbe_utility.get_time(); dbe_output.print_line('Time consumed:' ||(end_time - start_time)/100); END; / Time consumed: 1.2
enable_force_smp
Parameter description: Specifies whether to forcibly enable SMP. When this parameter is enabled, the cost of starting the stream thread is empty by default. When the degree of parallelism is set and the operator supports parallelism, the parallel path is forcibly selected. This parameter can be set at the PDB level.
Parameter type: Boolean.
Unit: none
Value range:
- on indicates that SMP is forcibly enabled.
- off indicates that SMP is not forcibly enabled.
Default value: off. In the PDB scenario, if this parameter is not set, the global setting is inherited.
Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1.
Setting suggestion: Retain the default value.
Risks and impacts of improper settings: Change the parameter value after fully understanding the parameter meaning and verifying it through testing.

- This parameter is valid only for operators that support SMP. For details, contact the administrator.
- In addition, the constraints on forcibly enabling SMP are as follows:
- The SMP feature improves the performance through operator parallelism and occupies more system resources, including CPU, memory, and I/O. It is used to save time at the cost of resources. By setting parallelism, SMP improves system performance in appropriate scenarios when resources are sufficient.
- If the scenarios are inappropriate (for example, the data volume is small) or resources are insufficient, the performance may deteriorate.
- This parameter is not supported in scenarios where SMP is not applicable.
enable_partrouting_optimization
Parameter description: Specifies whether to optimize the insertion of partitioned tables. This parameter can be set at the PDB level.
Parameter type: Boolean.
Unit: none
Value range:
- on: The insertion of partitioned tables is optimized. For the INSERT and SELECT statements, if the SELECT statement contains a constant partition key, partition routing needs to be performed only once for the INSERT statement, improving performance.
- off: The insertion of partitioned tables is not optimized. Before inserting each piece of data, you need to perform partition routing to determine the partitioned table to be inserted.
Default value: on. In the PDB scenario, if this parameter is not set, the global setting is inherited.
Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1.
Setting suggestion: Retain the default value.
Risks and impacts of improper settings: If this parameter is disabled, the performance optimization effect brought by this parameter is not affected in some scenarios where data is inserted into partitioned tables.

- Only INSERT and SELECT statements are supported.
- INSERT INTO ta SELECT FROM tb: For all partition key values inserted to table a, the column values in the corresponding SELECT result set must be constants. (This column is optional because the default values are constants.)
- INSERT INTO ta SELECT c,d FROM b WHERE tb.c='1' or SELECT '1' as c, d FROM tb: The result column tb.c is a constant.
- INSERT INTO ta SELECT c,d FROM b WHERE tb.c=func('1');: If func() is neither a volatile function nor a stable/immutable function that contains non-constant parameters, tb.c can be determined as a constant.
- If the column value is the return value of an aggregate function, for example, INSERT INTO ta SELECT count(c),d FROM b WHERE tb.c='1' group by c, d;, the count(c) cannot be determined as a constant.
- The UPSERT clause is not supported.
- Tables that contain BEFORE and INSTEAD triggers are not supported because the data to be inserted may be changed.
enable_unique_checking_of_unusable_index
Parameter description: Specifies whether to block the insert and update operations when there is an unusable unique index in the table.
Parameter type: Boolean.
Unit: none
Value range:
- on: If a table contains an UNUSABLE unique index, an INSERT statement and an UPDATE statement that involves the index will report an error, prompting you to process the unusable unique index first.
- off: If a table contains an UNUSABLE unique index, INSERT and UPDATE statements that involve the index will not report errors.
Default value: off
Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1.
Setting suggestion: Set this parameter based on service requirements. You are advised to set it to on.
Risks and impacts of improper settings: If this parameter is enabled, a large number of errors may be reported to ensure the uniqueness constraint. If this parameter is disabled, duplicate data in the unique index column is inserted into the table. As a result, the index cannot be rebuilt.

- For an Astore table, an error is reported when an index column of a non-UNUSABLE index is updated because a new tuple is generated.
- For a Ustore non-partitioned table, no error is reported when the index column of a non-UNUSABLE index is updated. If the update is not performed in place, an error is reported when the index column of a non-UNUSABLE index is updated.
- For a Ustore partitioned table, when the UNUSABLE unique index is a global index, an error is reported if the new data and old data are not in the same partition after the partition key is updated because a new tuple is generated.
- For a Ustore partitioned table, if the UNUSABLE unique index is a local index that contains the partition key, an error is reported when the partition key is updated.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot