# Pg_vectorsearch：比 pgvector 更快的向量索引

Original title: Pg_vectorsearch: An index that is faster than pgvector's IVFFlat and HNSW

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

▲ 206 · by [jascha_eng](<https://news.ycombinator.com/user?id=jascha_eng>) · 💬 52
[original](<https://github.com/timescale/pg_vectorsearch>) · [HN discussion](<https://news.ycombinator.com/item?id=50086165>)

## Summary

Timescale 推出了 PostgreSQL 扩展 pg_vectorsearch，旨在提供比 pgvector 的 IVFFlat 和 HNSW 更快的向量搜索性能。该扩展引入了基于 PRISM 的索引方法，结合 RaBitQ 量化技术和 SIMD 优化，在 1 亿向量数据集上，以四分之一的内存实现了超越 HNSW 的查询速度。它既支持原生 vec32/vec16 类型，也能直接兼容现有的 pgvector 表结构，无需重写数据即可构建新索引。目前项目处于 alpha 阶段，适合测试环境，未来有望成为大规模向量检索的高效解决方案。

## Key quote

> 与基于图的 HNSW 相比，PRISM 在 1 亿向量数据集上，仅需四分之一的内存即可在同等召回率下实现更快的速度。

## HN discussion (52 comments)

### [devy](<https://news.ycombinator.com/item?id=50087814>)

> 如果你正考虑采用这个扩展来替换之前 pgvector 的 HNSW 索引，这里有几点初步发现：
>
> \- pg_vectorsearch 使用一种名为 PRISM 的量化 IVF 索引。PRISM 将向量维度上限设为 1968。如果你之前的 HNSW 索引维度超过这个数，那你可就惨了（至少在他们修复之前是这样）。
>
> \- pg_vectorsearch 需要 PostgreSQL 18 或更高版本。如果你运行的是低于该版本的 PG，就得先迁移数据库。许多遗留的生产环境还停留在 PG 14 或 15 上，光是为了尝试这个功能就要付出高昂的迁移成本。
>
> \- pg_vectorsearch 昨天才发布，显然还处于 alpha 阶段。除了 Timescale 自己的环境外，尚未在生产环境中经过实战检验。而且由于它太新，目前还没有出现在 Azure 的允许扩展列表中，也没有其他超大规模云厂商托管 PG 实例的允许扩展列表中。从 alpha 到成熟需要时间。所以如果你用的是超大规模云厂商的托管 PG 实例，那你可就惨了（至少在这个功能成熟并进入那些生态系统之前是这样），或者你必须迁移到自托管的 PG 18。

### [mfreed](<https://news.ycombinator.com/item?id=50093486>)

> [Tiger Data CTO 在此]
>
> 关于 pg_vectorsearch，今天已经收到了很多很棒的问题、反馈，甚至已经有 PR 贡献。我写了一篇简短的技术深度解析，介绍其 PRISM 索引的架构，以回答其中一些问题，分享一下：
>
> https://www.linkedin.com/pulse/inside-pgvectorsearch-archite...

### [EgregiousCube](<https://news.ycombinator.com/item?id=50086834>)

> 我目前在使用 VectorChord，非常喜欢——配合高速磁盘，我的 PostgreSQL 成本直接减半。很高兴看到低内存向量索引工具领域出现竞争。RAMageddon 似乎正在激励大家寻找更多方法来利用现代 NVMe 驱动的高速特性！

### [arunmu](<https://news.ycombinator.com/item?id=50090420>)

> 这些人之前不是也写过 pgvectorscale 吗？那个好像现在没人维护了？
>
> 为什么不做成在 pgvectorscale 基础上改进或扩展，而是要搞个新索引？

### [Rapzid](<https://news.ycombinator.com/item?id=50086544>)

> 它支持过滤吗？
>
> 编辑：仅支持后过滤
>
> 我不明白人们是如何用这些索引高效实现租户/用户/权限范围的。

---

## Cite

- Page: https://zeli.app/zh/story/50086165
- Date: 2026-10-14
- Source: github.com (https://github.com/timescale/pg_vectorsearch)
- Hacker News: https://news.ycombinator.com/item?id=50086165

## Other languages

- en: https://zeli.app/story/50086165 · markdown: https://zeli.app/story/50086165.md
- ja: https://zeli.app/ja/story/50086165 · markdown: https://zeli.app/ja/story/50086165.md
- ko: https://zeli.app/ko/story/50086165 · markdown: https://zeli.app/ko/story/50086165.md
- de: https://zeli.app/de/story/50086165 · markdown: https://zeli.app/de/story/50086165.md
- es: https://zeli.app/es/story/50086165 · markdown: https://zeli.app/es/story/50086165.md
- ru: https://zeli.app/ru/story/50086165 · markdown: https://zeli.app/ru/story/50086165.md
