FAQs

Last updated: 2023-09-10 09:16:39

Why does the used storage capacity increase while no data is inserted?

This is because of PostgreSQL's Multi-Version Concurrency Control (MVCC) mechanism:
1. DELETE will not physically delete rows.
2. Rows updated through UPDATE are implemented by inserting new rows, and expired data is not directly physically deleted. Therefore, even without inserting data, there may be an increase in storage data volume.
The current TencentDB has enabled the autovacuum configuration parameter by default, and the kernel will automatically reclaim expired data. As a result, the used storage space will be released after the system reclaims the expired data. Users can also manually execute the VACUUM command to reclaim expired data (after executing this command, the storage space statistics will not decrease immediately, but the expired data will be reclaimed and marked as reusable). If you want to completely clean up the data, consider using the VACUUM FULL command with parameters (this command will lock the table, and it is strongly recommended to use it only during maintenance periods). For more information on using the VACUUM command, please refer to the PostgreSQL official documentation.

Why does my CPU utilization exceed 100%?

PostgreSQL, by default, employs an idle overuse strategy, allowing your business to seize some additional idle CPU resources. Therefore, when your instance exceeds the default allocated CPU cores, your CPU utilization monitoring view will display over 100%, which is normal. If your CPU load remains above 60% for an extended period, it is recommended that you upgrade your database as soon as possible.

Why is the used disk capacity larger than the actual data volume?

Updates cause a dramatic increase in xlog logs, and the system cannot archive and delete them in time, occupying disk space. Alternatively, query operations involving large amounts of data sorting, joining, and other operations generate temporary tables and overflow to the disk, causing substantial space usage in a short period.

How do I enable or use extensions?

TencentDB for PostgreSQL supports most commonly used extensions, which can be used directly. Some extensions require superuser privileges to enable, and can be activated through the Tencent Cloud Console. Alternatively, you can contact Tencent staff, providing the instance ID and extension name for activation.

What should I pay attention to when restarting a PostgreSQL instance?

Please exercise great caution when restarting a database, which plays a vital role in the business. Before the restart, it is recommended to disconnect the database from server and stop writing data.
Restarting an instance does not change its physical attributes, so the public IP, private IP, and any data stored on the instance will remain unchanged.
After the restart, reconnection to the database is needed. Make sure your business has a reconnection mechanism.
Restart the instance during off-peak hours to ensure success and minimize the impact on your business.
Generally, it takes tens of seconds to a few minutes to restart an instance, during which the instance cannot be accessed and existing connections to it will be closed.
During the restart, if the volume of business writes is too large and there are too many dirty pages, the restart may fail. If the restart fails, the instance will return to its previous state and remain accessible.
Restarting the database may occasionally fail, which is a normal phenomenon. If the restart takes longer than 10 minutes, it is recommended to consult through online support.

How do I terminate an instance?

You can manually terminate instances in the PostgreSQL console instance list.

How do I upgrade the PostgreSQL version?

TencentDB for PostgreSQL does not currently support major version upgrades. To perform a major version upgrade, use Data Transfer Service to migrate instance data.