Updated on 2024-06-03 GMT+08:00

Transaction

This section describes the settings and value ranges of database transaction parameters.

transaction_isolation

Parameter description: Specifies the isolation level of the current transaction.

This is a USERSET parameter. Set it based on instructions provided in Table 1.

Value range: a string of case-sensitive characters. The values include:

  • serializable: This value is equivalent to REPEATABLE READ in GaussDB.
  • read committed indicates that only the data in committed transactions is read.
  • repeatable read indicates that only the data committed before a transaction starts is read. Uncommitted data or data committed in other concurrent transactions cannot be read.
  • default: The value is the same as that of default_transaction_isolation.

Default value: read committed

transaction_read_only

Parameter description: Specifies that the current transaction is a read-only transaction.

This parameter has a fixed value on during database restoration or on the standby node. Otherwise, set this parameter to the value of default_transaction_read_only.

This is a USERSET parameter. Set it based on instructions provided in Table 1.

Value range: Boolean

  • on indicates that the current transaction is a read-only transaction.
  • off indicates that the current transaction can be a read/write transaction.

Default value: off

xc_maintenance_mode

Parameter description: Specifies whether the system is in maintenance mode.

This is a SUSET parameter. Set it based on method 3 provided in Table 1.

Value range: Boolean

  • on indicates that the function is enabled.
  • off indicates that the function is disabled.

Enable the maintenance mode with caution to avoid data inconsistencies in the database.

Default value: off

allow_concurrent_tuple_update

Parameter description: Specifies whether to allow concurrent update.

This is a USERSET parameter. Set it based on instructions provided in Table 1.

Value range: Boolean

  • on indicates that the function is enabled.
  • off indicates that the function is disabled.

Default value: on

transaction_deferrable

Parameter description: Specifies whether to delay the execution of a read-only serial transaction without incurring an execution failure. Assume this parameter is set to on. When the server detects that the tuples read by a read-only transaction are being modified by other transactions, it delays the execution of the read-only transaction until the other transactions finish modifying the tuples. This parameter is reserved and does not take effect in this version. Similar to this parameter, the default_transaction_deferrable parameter is used to specify whether to allow delayed execution of a transaction.

This is a USERSET parameter. Set it based on instructions provided in Table 1.

Value range: Boolean

  • on: allowed.
  • off: not allowed.

Default value: off

enable_show_any_tuples

Parameter description: This parameter is available only in a read-only transaction and is used for analysis. When this parameter is set to on or true, all versions of tuples in the table are displayed.

This is a USERSET parameter. Set it based on instructions provided in Table 1.

Value range: Boolean

  • on or true indicates that all versions of tuples in the table are displayed.
  • off or false indicates that no versions of tuples in the table are displayed.

Default value: off

In the TOAST scenario, if DML operations (mainly INSERT+UPDATE or INSERT+DELETE) are performed before and after the REINDEX operation, and the read-only transaction is started and the GUC parameter is enabled after the REINDEX operation, historical data in the TOAST table or TOAST index table can be queried separately in the released version. However, when historical data in the TOAST column is queried in the main table, the error message "missing chunk number xxx" is displayed.

replication_type

Parameter description: Specifies whether the current database is deployed in standalone or one-primary-multiple-standby mode.

This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Do not set the value of this parameter.

Value range: 0 to 2

  • 2 indicates the standalone mode. In this mode, no standby node can be added.
  • 1 indicates the one-primary-multiple-standby mode, covering all scenarios. This mode is recommended.
  • 0: reserved parameter.

Default value: 1

pgxc_node_name

Parameter description: Specifies the name of a node.

This is a POSTMASTER parameter. Set it based on Table 2.

When a standby node requests to replicate logs on the primary node, if the application_name parameter is not set, the pgxc_node_name parameter is used as the name of the streaming replication slot of the standby node on the primary node. The streaming replication slot is named in the following format: Value of this parameter_IP address of the standby node_Port number of the standby node. The IP address and port number of the standby node are obtained from the IP address and port number of the standby node specified by the replconninfo parameter. The maximum length of a streaming replication slot name is 61 characters. If the length of the concatenated string exceeds 61 characters, the truncated pgxc_node_name will be used for concatenation to ensure that the length of the streaming replication slot name is less than or equal to 61 characters.

After this parameter is modified, the database instance will fail to be connected. You are advised not to modify this parameter.

Value range: a string

Default value: current node name

enable_defer_calculate_snapshot

Parameter description: Specifies the delay in calculating xmin and oldestxmin. Calculation is triggered only when 1000 transactions are executed or the interval is 1s. If this parameter is set to on, the overhead of calculating snapshots can be reduced in heavy-load scenarios, but the progress of updating oldestxmin is slow, affecting tuple recycling. If this parameter is set to off, xmin and oldestxmin can be calculated in real time, but the overhead for calculating snapshots increases.

Parameter type: Boolean

Unit: none

Value range:

  • on indicates that snapshots xmin and oldestxmin are calculated with a delay.
  • off indicates that snapshots xmin and oldestxmin are calculated in real time.

Default value: on

Setting method: This is a SIGHUP parameter. Set it based on Table 2.

seqscan_csn_cache_num

Parameter description: Specifies the size of the CSN cache. The cache is used only when the Seq Scan scans the heap table page through the MVCC snapshot to determine the visibility. If this parameter is set to 0, the CSN cache mechanism is not used.

This is a PGC_SIGHUP parameter. Set it based on Table 2.

Value range: an integer ranging from 0 to 1000.

Default value: 100.