Do not use index without limit or if limit + offset > expected tuples

This commit is contained in:
Andrew Kane
2024-01-20 15:16:30 -08:00
parent 042ddfdc8a
commit 63c4af0454
23 changed files with 177 additions and 45 deletions

View File

@@ -23,10 +23,11 @@ sub insert_vectors
sub test_duplicates
{
# TODO Improve
my $res = $node->safe_psql("postgres", qq(
SET enable_seqscan = off;
SET hnsw.ef_search = 1;
SELECT COUNT(*) FROM (SELECT * FROM tst ORDER BY v <-> '[1,1,1]') t;
SET hnsw.ef_search = 10;
SELECT COUNT(*) FROM (SELECT * FROM tst ORDER BY v <-> '[1,1,1]' LIMIT 10) t;
));
is($res, 10);
}