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

Flashback

This section describes parameters related to the flashback function. In this version, only the Ustore engine supports flashback, while the Astore engine does not support flashback.

enable_recyclebin

Parameter description: Specifies whether the recycle bin is enabled or disabled in real time.

Parameter type: Boolean

Value range:
  • on indicates that the recycle bin is enabled in real time.
  • off indicates that the recycle bin is disabled in real time.

Default value: off

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Setting suggestion: To use the flashback table function, set enable_recyclebin to on.

recyclebin_retention_time

Parameter description: Specifies the retention period of objects in the recycle bin. The objects will be automatically deleted after the retention period expires.

Parameter type: integer

Unit: s

Value range: 1 to 2147483647.

Default value: 15 min (900s)

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1. For example, if the value is 900 without a unit, recyclebin_retention_time indicates 900s. If the value is 15min, recyclebin_retention_time indicates 15 minutes. If the unit is required, the value must be s, min, h, or d.

version_retention_age

Parameter description: Specifies the number of transactions retained in earlier versions. The earlier versions with the number of transactions larger than the value of this parameter will be recycled and cleared.

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

Value range: an integer ranging from 0 to 576460752303423487. 0 means no delay.

Default value: 0

This parameter has been deprecated.

vacuum_defer_cleanup_age

Parameter description: Determines whether a dead tuple can be physically deleted based on the global minimum active transaction oldestxmin. If the value is less than oldestxmin, the dead tuple is physically deleted. If vacuum_defer_cleanup_age is set to a value greater than 0, the recycling of dead tuples needs to be delayed. In this case, the result of oldestxmin minus vacuum_defer_cleanup_age is used as the new threshold for clearing dead tuples.

For example, if oldestxmin and vacuum_defer_cleanup_age are set to 200 and 50, respectively, the new threshold is 150 (that is, 200 – 50). The tuples whose XID < 150 will be physically deleted.

Parameter type: integer

Unit: none

Value range: 0 to 1000000. 0 means no delay.

Default value: 0

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Retain the default value.

undo_retention_time

Parameter description: Specifies the period for retaining undo logs of earlier versions.

Parameter type: integer

Unit: s

Value range: 0 to 259200.

Default value: 0

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

  1. If this parameter is set to 0 during the Ustore flashback query, the snapshot information at the flashback point will be cleared. In earlier versions, no flashback query can be performed. When a flashback query is performed, the error message "cannot find the restore point" is displayed.
  2. If the time within which the undo logs of earlier versions need to be retained is time1 and the SQL statement execution time for the flashback query is time2, you need to set undo_retention_time to a value greater than time1 + time2. That is, set undo_retention_time to a value greater than time1 + time2 + 3s. You are advised to set undo_retention_time to a value equal to time1 + 1.5 x time2. For example, if you want to retain the logs of earlier versions within the latest 3 hours, and the SQL statement execution time for the flashback query is 1 hour, set undo_retention_time to a value equal to 3 hours + 1.5 x 1 hour, that is, 4.5 hours.