# BRIN 索引在 5% 更新后性能崩塌

Original title: BRIN is 1/4570th the size of a B-tree, until 5% of rows are updated

> Hacker News story 49467402 · language: zh · submitted 2026-08-27
> Web version: https://zeli.app/zh/story/49467402
> About this feed: https://zeli.app/llms.txt · Agent guide: https://zeli.app/skill.md

▲ 14 · by [venkat971](<https://news.ycombinator.com/user?id=venkat971>) · 💬 3
[original](<https://deepsql.ai/blog/the-zonemap-shaped-hole-in-postgres>) · [HN discussion](<https://news.ycombinator.com/item?id=49467402>)

## Summary

作为 Oracle Zonemaps 模块的联合所有者，我在 Postgres 中测试了 BRIN 索引的极限。在数据完全有序时，BRIN 索引大小仅为 B-tree 的 1/4570，性能极佳。然而，一旦 5% 的行被更新，索引的剪枝能力会瞬间崩塌 28 倍，导致查询性能急剧下降。文章揭示了 BRIN 在混合更新场景下的致命弱点：物理顺序的微小破坏会导致范围摘要失效，而 pg_stats.correlation 指标对此毫无察觉。虽然 CLUSTER 可以恢复性能，但需要付出昂贵的维护代价。对于非纯追加写入的表，BRIN 可能是一个隐藏的陷阱。

## Key quote

> 相关性衡量的是列与物理位置的全局排序，而 BRIN 关心的是每个区间的极值，少量异常值几乎不影响前者，却会彻底摧毁后者。

---

## Cite

- Page: https://zeli.app/zh/story/49467402
- Date: 2026-08-27
- Source: deepsql.ai (https://deepsql.ai/blog/the-zonemap-shaped-hole-in-postgres)
- Hacker News: https://news.ycombinator.com/item?id=49467402

## Other languages

- en: https://zeli.app/story/49467402 · markdown: https://zeli.app/story/49467402.md
