From: ankane (@ankane) <noreply+ankane@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #812: Can an index be used with a nested loop?
Date: Tue, 01 Apr 2025 00:24:37 +0000
Message-ID: <gh-pgvector-pgvector-812-c2767707736@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-812@github.com>
References: <gh-pgvector-pgvector-812@github.com>
Hi @lounging-lizard, the `UNION ALL` approach is the best way to accomplish this - see #59 and https://github.com/pgvector/pgvector/issues/713#issuecomment-2469289695 (even if the Postgres planner gained the ability to use the index in the first query, it would still need to do 5 separate index lookups).