Get the latest tech news

Understanding Pgvector's HNSW Index Storage in Postgres


In this article, we'll explore how pgvector works under the hood, focusing on how the HNSW index is stored in Postgres.

magicNumber → constant which is 0xA953A953 hex number, used to detect early potential header corruption or accidental page structure mismatch. Let’s try to visualize the connections of index tuples by mapping structs to JSON representations to better understand what is happening under the hood. We ported this parser to WASM and built an interactive demo using PGlite to better visualize the storage layout of pgvector’s HNSW index.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of Postgres

Postgres

Photo of pgvector

pgvector

Photo of hnsw index storage

hnsw index storage

Related news:

News photo

Understanding the Postgres Hackers Mailing List

News photo

Scaling Rails and Postgres to millions of users at Microsoft

News photo

Degrees of Kevin Bacon Using Postgres