PostgreSQL 19首个候选版已发布,正式版预计11月19日推出,生产环境仍应使用18版。因可靠性优先,SQL属性图查询、分区合并拆分等功能被撤回。新特性包括:REPACK CONCURRENTLY可在线回收表空间,但最终切换仍需排他锁;pg_plan_advice可约束查询计划;autovacuum支持并行索引清理并按评分优先排序;逻辑复制可同步序列值,但发布端须为19版且非持续同步。此外JIT默认关闭。建议在非生产环境用真实负载充分测试。
PostgreSQL 19 三月 CommitFest 中与 DBA 课程相关的改进包括:新增 REPACK 命令,合并 VACUUM FULL 与 CLUSTER,并支持 CONCURRENTLY 在线重建;autovacuum 引入按评分排序的优先级机制及并行索引清理;事务 ID 回卷警告提前至一亿事务并显示剩余百分比;检查点完成日志加入原因;可见性映射可在页面访问时更新;新增 pg_stat_lock 锁等待统计视图。
And now, we put on our waders and venture into the swamp that is all of the PostgreSQL logging GUCs. PostgreSQL 8.3 is the release in which the server started doing its own housekeeping in...
Postgres 19改进了autovacuum调度,引入基于分数的优先级系统,按表的事务ID年龄、死元组数等指标排序,并新增权重参数调整优先级,支持并行处理索引。新视图pg_stat_autovacuum_scores提供透明度,提升维护效率。
Postgres 19引入了REPACK命令,解决了表膨胀问题,允许在不锁定整个表的情况下重写表。通过调整autovacuum设置,可以有效管理表的大小。REPACK命令支持并发执行,提升了性能,同时需注意MVCC安全性,为数据库管理员提供了优化工具。
PostgreSQL 18 splits autovacuum configuration to finally let you tune worker concurrency without restarting.
autovacuum_work_mem sets the maximum memory each autovacuum worker may use for tracking dead tuple identifiers (TIDs) during a vacuum. Default is -1, which means “inherit from...
Autovacuum's most powerful tuning lever: the scale factor that determines when dead tuples trigger a vacuum. On large tables, the 20% default waits too long.
PostgreSQL 18 finally fixes the autovacuum formula that left billion-row tables waiting for 200M dead tuples.
PostgreSQL 13 added insert-triggered autovacuum to solve a critical problem: append-only tables never vacuumed, breaking index-only scans and delaying tuple…
Three autovacuum parameters control how often PostgreSQL vacuums, how hard it works, and how long it pauses.
Prevent MultiXact ID wraparound by controlling when autovacuum freezes old locks.
Raising autovacuum_max_workers above 3 won't speed up vacuum unless you also increase autovacuum_vacuum_cost_limit—the I/O budget is divided among workers, not…
PostgreSQL wraps transaction IDs every two billion transactions—autovacuum_freeze_max_age stops your database from crashing when it does.
文章讨论了PostgreSQL中的自动真空分析参数:autovacuum_analyze_scale_factor和autovacuum_analyze_threshold。这两个参数决定了何时对表进行ANALYZE。默认设置在大表上可能导致统计信息过时,影响查询性能。因此,建议针对大于一百万行的表调整这些参数,以提高分析频率,确保统计信息及时更新,从而优化查询效率。
Disable autovacuum and PostgreSQL will cheerfully show you every failure mode in its playbook, from table bloat to transaction ID wraparound.
PostgreSQL 19 ships with parallel autovacuum. The new GUC autovacuum_max_parallel_workers caps the cluster-wide pool, and the per-table storage parameter autovacuum_parallel_workers lets you tune...
本文介绍了四种减少PostgreSQL行数估计误差的方法:1. 调整autovacuum自动分析频率;2. 增加每列的统计采样目标;3. 使用扩展统计处理列间相关性;4. 最后手段使用pg_hint_plan控制查询计划。通过这些方法可有效提升查询性能。
PostgreSQL 18的1月CommitFest带来了监控和新功能的显著改进,包括EXPLAIN ANALYZE默认显示缓冲区信息,pg_stat_io视图新增读取、写入和扩展字节列,以及新函数pg_stat_get_backend_io提供I/O统计信息。VACUUM输出增加可见性图信息,pg_stat_all_tables视图新增跟踪时间列,用户可动态调整autovacuum工作进程数量,MD5密码加密被标记为过时。
2025年1月6日,Nathan Bossart提交补丁,允许动态调整autovacuum_max_workers而无需重启服务器。新增参数autovacuum_worker_slots控制启动时的工作槽数量,修改该参数需重启。设置不当会发出警告,现有工作者继续运行,直到数量低于设定值。这一改动增强了自动清理工作的灵活性。
完成下面两步后,将自动完成登录并继续当前操作。