From: Zhangooses (@Zhangooses) <noreply+Zhangooses@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: [pgvector/pgvector] issue #887: PGVector HNSW Index Sizes appear to be the same despite having different construction parameters?
Date: Fri, 15 Aug 2025 17:09:19 +0000
Message-ID: <gh-pgvector-pgvector-887@github.com> (raw)
Hi! I'm using the PGVector extension to create HNSW indexes with different construction parameters. My goal is to see if I will get better recall with the index with higher value m/ef_construction values. However what's weird is that the sizes are the exact same?
for example,
CREATE INDEX test_index
ON test
USING hnsw (embedding vector_l2_ops)
WITH (m = 30, ef_construction = 200)
WHERE field1 = 'male' AND field2 = true;
CREATE INDEX test_index _2
ON test
USING hnsw (embedding vector_l2_ops)
WITH (m = 70, ef_construction = 800)
WHERE field1 = 'male' AND field2 = true;
However:
SELECT pg_size_pretty(pg_relation_size('test_index')) AS index_size;
SELECT pg_size_pretty(pg_relation_size('test_index_2')) AS index_size;
Both have the same value (in this case ~500MB). Any reasoning why? Can confirm that both indexes are created successfully. I would suspect test_index_2 to be way bigger