PostgreSQL 上可以列出建議增加 index 的 extension

Twitter 上看到 Percona 家老大貼他們自家 2019 年的舊文章:「Automatic Index Recommendations in PostgreSQL using pg_qualstats and hypopg」。

先說一下,因為要另外裝 extension,目前 Amazon RDS 上面是沒辦法用的,但自己管理的 PostgreSQL 就可以考慮看看。

看了一下文章裡面介紹的兩個 extension,一個是 HypoPG,另外一個是 pg_qualstats,看起來組合技可以提供不少有用的建議。

目前只有針對 B-tree index 提供建議,但這應該已經相當足夠了,大多數的場景下應該都是用 B-tree:

With this experiment, we see that we can use hypopg and pg_qualstats to automate index recommendations. The automation logic is currently limited to B-Tree Indexes only.

另外看 Percona 的 PostgreSQL 文章都會習慣翻了一下作者的背景 (之前被雷過),看起來作者 Avinash Vallarapu 在今年年初已經離開 Percona,成立自己的公司 MigOps 提供 PostgreSQL 相關的服務了...