pg.ddx.io  pgvector/pgvector GitHub issues and pull requests  
help / color / mirror / Atom feed
From: jkatz (@jkatz) <noreply+jkatz@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: Mon, 22 Jan 2024 02:11:52 +0000
Message-ID: <gh-pgvector-pgvector-424-c1902902924@github.com> (raw)
In-Reply-To: <gh-pgvector-pgvector-424@github.com>
References: <gh-pgvector-pgvector-424@github.com>

> The issue with low selectivity using a vector index is the query will likely return few or no results, which happens now (https://github.com/pgvector/pgvector/issues/263).

@ankane I understand that -- but I'm not sure if measuring on selectivity alone will account for this. For example, a selectivity of 0.05 on a dataset of 100K has a far higher chance of not returning enough tuples vs. a dataset of 100MM.

> Apart from the specific implementation, I'd be curious to hear thoughts on whether the test cases make sense. For instance, does it make sense to use an index for the following query with the default ef_search of 40?
> ```sql
> SELECT * FROM tst ORDER BY v <-> '[1,2,3]' LIMIT 41; -- or 10000
> ```

🤔 I wonder if another approach would be to error when there's a LIMIT/ef_search mismatch.

view thread (15+ messages)  latest in thread

Message-ID: <gh-pgvector-pgvector-424-c1902902924@github.com>
Permalink:  ../gh-pgvector-pgvector-424-c1902902924@github.com/

 · 


This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox