From: xcu (@xcu) <noreply+xcu@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: [pgvector/pgvector] issue #735: Compression rate with BQ and HNSW
Date: Fri, 13 Dec 2024 12:07:29 +0000
Message-ID: <gh-pgvector-pgvector-735@github.com> (raw)
I'm trying to test recall and speed for different BQ setups with HNSW indexes because the cost of the DB host for big-ish datasets becomes too high.
I have noticed that reducing m parameter to construct the HNSW index results in a more compressed index that takes less space, and as a result I have to increase ef_construction to keep recall more or less at an acceptable level.
For m=8, ef_search=512 and embeddings of 512 dimensions I am getting a 10:1 compression rate (as in, if the dataset required 100GB with HNSW flat, now it takes 10GB). I was wondering if you guys have any tips to get the best possible compression rate without affecting recall too much.
I guess the best rate in theory would be 32:1 (4 bytes compressed into a bit), but when it comes to real life implementation the rate actually decreases. What would be the actual limits? Are there some docs giving an overview of how the indexes are built and what takes the extra space?