From: michaelbautin (@michaelbautin) <noreply+michaelbautin@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] PR #765: Functions to estimate the amount of memory for building an HNSW index
Date: Tue, 28 Jan 2025 02:23:37 +0000
Message-ID: <gh-pgvector-pgvector-765-c2617621049@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-765@github.com>
References: <gh-pgvector-pgvector-765@github.com>
@ankane
> If someone comes up with an approximate formula based on actual data from different datasets and index options
I am not sure what you mean by "formula based on actual data". The only parameters influencing the HNSW build memory consumption are M (given that mL is computed based on M), the number of vectors, and per-vector memory usage, assuming it is the same for all vector, which covers a lot of use cases. Given those parameters, the memory usage can be estimated with a very high precision and there is no need for any additional data collection from different datsets.