From: ankane (@ankane) <noreply+ankane@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] PR #424: Update cost estimation to not use index when expected tuples is too low
Date: Sun, 21 Jan 2024 21:13:40 +0000
Message-ID: <gh-pgvector-pgvector-424-rc1461131660@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-424@github.com>
References: <gh-pgvector-pgvector-424@github.com>
(on src/hnsw.c:104)
The `DEFAULT_INEQ_SEL` check ensures the index is still used for `WHERE v <-> '[1,2,3]' < 1` (when there's an `ORDER BY` and `LIMIT`). This also means it's used for `WHERE v <-> '[1,2,3]' > 1`, which shouldn't really use an index (however, it currently does in existing releases).