且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

【重新发现PostgreSQL之美】- 32 天不怕地不怕, 就怕老板问为什么?

更新时间:2021-10-27 00:39:18

背景


场景:

  • 黑天鹅, 突发事件.
  • 负载突然升高, 响应突然变慢.

挑战:

  • 已经发生的突发事件, 如何分析其原因? 哪里有 数据、案例、逻辑 ?

PG 解决方案:

  • 性能洞察, 采样点(平均活跃会话数、等待事件、SQL细粒度)
  • stats 统计快照
  • auto_explain, 设置阈值, 超出记录执行和消耗详情.
  • 锁等待日志记录.

参考


《PostgreSQL pg_stat_statements AWR 插件 pg_stat_monitor , 过去任何时间段性能分析 [推荐、收藏]》

《PostgreSQL 函数调试、诊断、优化 & auto_explain & plprofiler》

《PostgreSQL Oracle 兼容性之 - performance insight - AWS performance insight 理念与实现解读 - 珍藏级》

https://www.postgresql.org/docs/14/auto-explain.html

https://www.postgresql.org/docs/devel/runtime-config-locks.html