怎么清零出空间呢,数据库表里面数据不多
建立了额外的四个表空间独立存储每月新增数据。
旧缓存数据定期删除。

怎么清零出空间呢,数据库表里面数据不多
建立了额外的四个表空间独立存储每月新增数据。
旧缓存数据定期删除。
1 n0099 Jan 11, 2023 > 1GB 大小文件 这是 pgsql 的一个文件分片机制: https://www.postgresql.org/docs/current/storage-file-layout.html > When a table or index exceeds 1 GB, it is divided into gigabyte-sized segments. The first segment's file name is the same as the filenode; subsequent segments are named filenode.1, filenode.2, etc. This arrangement avoids problems on platforms that have file size limitations. (Actually, 1 GB is just the default segment size. The segment size can be adjusted using the configuration option --with-segsize when building PostgreSQL.) In principle, free space map and visibility map forks could require multiple segments as well, though this is unlikely to happen in practice. 根据 https://dba.stackexchange.com/questions/48273/whats-stored-in-data-dir-base-of-postgresql https://dba.stackexchange.com/questions/228114/why-is-my-postgres-base-directory-filling-up-rapidly 您有执行过[VACUUM]( https://www.postgresql.org/docs/current/routine-vacuuming.html#VACUUM-FOR-SPACE-RECOVERY)吗 |
3 cstj0505 Jan 11, 2023 vacuum full xx 表 会锁表。 |
4 ericFork Jan 13, 2023 pg_repack 或者类似的工具了解一下 |