Updated on 2025-05-29 GMT+08:00

Global Temporary Table

max_active_global_temporary_table

Parameter description: Specifies whether global temporary tables can be created. The value of this parameter determines the memory reserved in the shared cache for hash tables required by global temporary tables. The total number of active global temporary tables in all sessions is not forcibly limited.

Parameter type: integer.

Unit: none

Value range: 0 to 1000000

  • 0: The global temporary table function is disabled.
  • > 0: The global temporary table function is enabled.

Default value: 1000

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.

vacuum_gtt_defer_check_age

Parameter description: Specifies the difference between the minimum value of relfrozenxid of all global temporary tables and that of all ordinary tables in the current database after VACUUM is executed. If the minimum value of relfrozenxid of all global temporary tables is greater than the specified value, the alarm "global temp table oldest relfrozenxid %lu is the oldest in the entire db" is generated to remind users to manually execute VACUUM. Otherwise, Clogs may not be recycled.

Parameter type: integer.

Unit: none

Value range: 0 to 1000000

Default value: 10000.

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.

enable_gtt_concurrent_truncate

Parameter description: Specifies whether to support concurrent execution of TRUNCATE TABLE and DML operations on global temporary tables and concurrent execution of TRUNCATE TABLE on global temporary tables.

Parameter type: Boolean.

Unit: none

Value range:

  • on: The preceding operations can be performed concurrently.
  • off: The preceding operations cannot be performed concurrently.

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.

global_gtt_cn_session_key

Parameter description: Specifies the ID of the current session, that is, the global unique session ID of a distributed global temporary table.

Parameter type: string.

Unit: none

Value range: a string.

Default value: none

Setting method: This is an internal parameter and cannot be set by users. No query result is returned.

Setting suggestion: No setting is allowed.

Risks and impacts of improper settings: none