Reorganize tables in PostgreSQL databases with minimal locks
pg_repack:优化 PostgreSQL 数据库表的高效工具
- 官网: https://reorg.github.io/pg_repack
- 下载: https://pgxn.org/dist/pg_repack/
- 开发: https://github.com/reorg/pg_repack
- 报告问题: https://github.com/reorg/pg_repack/issues
|GitHub 活动状态|
.. |GitHub 活动状态| image:: https://github.com/reorg/pg_repack/actions/workflows/regression.yml/badge.svg :target: https://github.com/reorg/pg_repack/actions/workflows/regression.yml :alt: Linux 构建状态
pg_repack 是一个 PostgreSQL 扩展,允许您从表和索引中消除膨胀,并可选择恢复聚簇索引的物理顺序。与 CLUSTER 和 VACUUM FULL 不同,它在线运行,在处理期间不对处理的表持有独占锁。pg_repack 效率高,性能接近直接使用 CLUSTER。
请查阅文档(在 "doc" 目录或在线)获取安装和使用指南。
.. _pg_repack: https://reorg.github.io/pg_repack .. _CLUSTER: https://www.postgresql.org/docs/current/static/sql-cluster.html .. VACUUM FULL: VACUUM .. _VACUUM: https://www.postgresql.org/docs/current/static/sql-vacuum.html .. _在线: https://reorg.github.io/pg_repack .. _问题: https://github.com/reorg/pg_repack/issues/23
关于 pg_reorg 的情况如何?
pg_repack 是 pg_reorg_ 项目的分支,后者已取得巨大的成功。遗憾的是,自2011年底以来,pg_reorg_ 的新功能开发已经减缓或停止。
pg_repack 最初发布作为 pg_reorg 的即插即用替代品,解决了上一版本 pg_reorg 的一些不足(如支持 PostgreSQL 9.2 及 EXTENSION 包装)和已知错误。
pg_repack 1.2 引入了更多新特性(并行索引构建,仅重建索引的能力)和修复了错误。在某些情况下,其行为可能与 1.1.x 版本不同,因此不应被视为直接替代品:升级前建议查看文档__。
.. __: https://reorg.github.io/pg_repack .. _pg_reorg: <https