From: ankane (@ankane) <noreply+ankane@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #846: Unexpected use of Index Scan in ANN query without LIMIT or enable_indexscan
Date: Wed, 28 May 2025 23:58:29 +0000
Message-ID: <gh-pgvector-pgvector-846-c2917869305@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-846@github.com>
References: <gh-pgvector-pgvector-846@github.com>
From what I can tell, this is due to the cost of an external merge sort (for the seq scan) being very high for the query with the default `work_mem`. I believe the only way to address this would be to increase the total cost of the HNSW scan, but would like to get a framework in-place for better testing cost estimation before this.