From: brycechesternewman (@brycechesternewman) <noreply+brycechesternewman@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #949: HNSW partitions and parameters
Date: Thu, 22 Jan 2026 15:38:54 +0000
Message-ID: <gh-pgvector-pgvector-949-c3785076630@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-949@github.com>
References: <gh-pgvector-pgvector-949@github.com>
Hi @ankane,
Thanks for responding.
We are already using the default parameters and seeing low recall.
The question is do I need different hnsw parameters for the `ix_perceptual_hash` index vs the partitioned indexes?
As an hnsw parameters example...
Is this correct?
```
CREATE INDEX IF NOT EXISTS ix_perceptual_hash ON ONLY Hashes USING hnsw (perceptualHash bit_hamming_ops) WITH (m = 64, ef_construction = 256);
CREATE INDEX CONCURRENTLY imagehashes_p0_perceptualhash_idx ON Hashes_p0 USING hnsw (perceptualHash bit_hamming_ops) WITH (m = 16, ef_construction = 128);
ALTER INDEX ix_perceptual_hash ATTACH PARTITION imagehashes_p0_perceptualhash_idx;
CREATE INDEX CONCURRENTLY imagehashes_p1_perceptualhash_idx ON Hashes_p1 USING hnsw (perceptualHash bit_hamming_ops) WITH (m = 16, ef_construction = 128);
ALTER INDEX ix_perceptual_hash ATTACH PARTITION imagehashes_p1_perceptualhash_idx;
...
```
or this?
```
CREATE INDEX IF NOT EXISTS ix_perceptual_hash ON ONLY Hashes USING hnsw (perceptualHash bit_hamming_ops) WITH (m = 64, ef_construction = 256);
CREATE INDEX CONCURRENTLY imagehashes_p0_perceptualhash_idx ON Hashes_p0 USING hnsw (perceptualHash bit_hamming_ops) WITH (m = 64, ef_construction = 256);
ALTER INDEX ix_perceptual_hash ATTACH PARTITION imagehashes_p0_perceptualhash_idx;
CREATE INDEX CONCURRENTLY imagehashes_p1_perceptualhash_idx ON Hashes_p1 USING hnsw (perceptualHash bit_hamming_ops) WITH (m = 64, ef_construction = 256);
ALTER INDEX ix_perceptual_hash ATTACH PARTITION imagehashes_p1_perceptualhash_idx;
...
```