From: jkatz (@jkatz) <noreply+jkatz@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #688: HNSW Index Size Constant with Different Index Build Params
Date: Tue, 01 Oct 2024 14:06:21 +0000
Message-ID: <gh-pgvector-pgvector-688-c2386072026@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-688@github.com>
References: <gh-pgvector-pgvector-688@github.com>
@wahajali The overall size of the index is affected by how much data you can fit into a PostgreSQL index page, which is 8KB (8192 bytes) in size.
`m` impacts the number of links being maintained between tuples (vectors) in the graph. The actually size of the links is pretty small (bytes) - so increasing `m` won't add too much to each entry, particularly if your vectors take up most of the page (an unquantized 1,536 dim vector takes up 6KiB, so it will use the entirety of an index page, so it takes up 8KiB in the index).
`ef_construction` is only used while inserting a tuple (vector) into the index, as this maintains the list of "closest neighbors" - this impacts index construction, but not size.