Undo
The GUC parameter of undo is valid only for the Ustore.
undo_space_limit_size
Parameter description: Specifies the threshold for forcibly recycling undo space. When the undo space usage reaches 80% of the threshold, forcible recycling starts. You are advised to set undo_space_limit_size to a value greater than or equal to that of undo_limit_size_per_transaction.
Parameter type: integer.
Unit: page (8 KB)
Value range: 102400 to 2147483647. The default unit is page.
Default value: 33554432 (that is, 256 GB)
Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1. For example, the value 1000000 indicates 1,000,000 pages, and the value 1000000kB indicates 1,000,000 KB. If the value contains a unit, the value can be KB, MB, or GB, but cannot be TB.
Setting suggestion: Retain the default value. If the disk space is too small to meet the default value requirements, set this parameter to a smaller value. If long transactions or large transactions exist in your service, set undo_space_limit_size to a larger value based on the disk usage. For details about the value setting, see the info column of the gs_stat_undo system function in "SQL Reference > Functions and Operators > System Administration Functions > Undo System Functions > gs_stat_undo parameters" in Developer Guide.
Risks and impacts of improper settings: If this parameter is set to a small value when undo records cannot be reclaimed in a timely manner, undo records may be forcibly reclaimed. As a result, there is an extremely low probability that the error message "snapshot too old! the undo record has been forcibly discard" is displayed. If this parameter is set to a large value when the disk space is insufficient and undo records cannot be reclaimed in a timely manner, a large number of undo records may be retained in the database system. As a result, the undo records occupy the physical disk space with other data, and services may be affected when the disk space is insufficient.
undo_limit_size_per_transaction
Parameter description: Specifies the undo space threshold of a single transaction. If the threshold is reached, the transaction is rolled back due to an error. You are advised to set undo_limit_size_per_transaction to a value less than or equal to that of undo_space_limit_size. If the value of undo_limit_size_per_transaction is greater than that of undo_space_limit_size, the displayed value is the same as the configured value when you run the show undo_limit_size_per_transaction command to query the parameter value. The only difference is that the smaller value between undo_space_limit_size and undo_limit_size_per_transaction is used as the actual undo space threshold of a single transaction.
Parameter type: integer.
Unit: page (8 KB)
Value range: 256 to 2147483647. The default unit is page. If this parameter is set to a value greater than 134217728 (that is, 1 TB), the value 134217728 takes effect.
Default value: 4194304 (32 GB)
Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1. For example, if the value is 10000, undo_limit_size_per_transaction is 10,000 pages. If the value is 10000kB, undo_limit_size_per_transaction is 10,000 KB. If the value contains a unit, the value can be KB, MB, or GB, but cannot be TB.
Setting suggestion: Retain the default value. If the disk or memory space is too small to meet the requirements of the default value, set this parameter to a smaller value. If long transactions or large transactions exist in your service, and the number of Undo records generated in a single transaction is greater than the value of this parameter, set undo_limit_size_per_transaction to a larger value based on the disk usage. For details about the value setting, see the info column of the gs_stat_undo system function in "SQL Reference > Functions and Operators > System Administration Functions > Undo System Functions > gs_stat_undo parameters" in Developer Guide. If undo_limit_size_per_transaction is set to a value greater than 1 TB, the system performance and stability may be affected. Therefore, if the parameter is set to a value greater than 134217728 (that is, 1 TB), the configured value is displayed when you run the show undo_limit_size_per_transaction command to query the parameter value, but the value 134217728 takes effect.
Risks and impacts of improper settings: If the parameter is set to small value, the number of undo records generated in a single transaction may exceed the threshold. As a result, the error message "undo size of the transaction exceeds the threshold" is displayed and the transaction is rolled back.
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