From: jkatz (@jkatz) <noreply+jkatz@github.com>
To: pgvector/pgvector <noreply+pgvector-pgvector@github.com>
Subject: Re: [pgvector/pgvector] issue #719: SELECT WHERE ORDER BY LIMIT no results
Date: Tue, 03 Dec 2024 15:08:39 +0000
Message-ID: <gh-pgvector-pgvector-719-c2514833236@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-719@github.com>
References: <gh-pgvector-pgvector-719@github.com>
@Tibiritabara The short answers is that I would recommend upgrading to pgvector 0.8.0 which has features to addressed overfiltering. You can read more about those here:
https://github.com/pgvector/pgvector/?tab=readme-ov-file#filtering
(I also just gave a presentation of those features, but the slides/video are not available yet).
In the case that you have highly selective filters in your `METADATA` (high selectivity means only a limited number rows are returned), you can also use a GIN index on your `jsonb` column to search over that data, which could not only end up being faster, but would return the results with better recall. More information on that is here: https://www.postgresql.org/docs/current/datatype-json.html#JSON-INDEXING
(Also, the `1=1` in the query doesn't actually do anything; you can remove it).