pgvector.git / summary / log / commit / refs
commit 4bd4a0996bf1fe26cde4fa0ef0284dbbc75cb259
Author: Andrew Kane <andrew@ankane.org>
Date: Sun Jan 21 05:01:57 2024 +0000
Improved filtering test [skip ci]
test/t/018_hnsw_filtering.pl | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/test/t/018_hnsw_filtering.pl b/test/t/018_hnsw_filtering.pl
index 058009c7..21b890a5 100644
--- a/test/t/018_hnsw_filtering.pl
+++ b/test/t/018_hnsw_filtering.pl
@@ -45,6 +45,13 @@ $explain = $node->safe_psql("postgres", qq(
));
like($explain, qr/Index Scan using idx/);
+# Test distance filtering greater than distance
+$explain = $node->safe_psql("postgres", qq(
+ EXPLAIN ANALYZE SELECT i FROM tst WHERE v <-> '$query' > 1 ORDER BY v <-> '$query' LIMIT $limit;
+));
+# TODO Do not use index
+like($explain, qr/Index Scan using idx/);
+
# Test distance filtering without order
$explain = $node->safe_psql("postgres", qq(
EXPLAIN ANALYZE SELECT i FROM tst WHERE v <-> '$query' < 1;
[parent: 490522b8834d]