pgvector.git / summary / log / commit / refs
commit d5da22f24b96ac76d01a84c96a9366ce8280b090
Author: Andrew Kane <andrew@ankane.org>
Date: Mon Feb 07 04:14:21 2022 +0000
Fixed tests
test/t/003_recall.pl | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/test/t/003_recall.pl b/test/t/003_recall.pl
index fbce26aa..44e421fd 100644
--- a/test/t/003_recall.pl
+++ b/test/t/003_recall.pl
@@ -10,9 +10,13 @@ my @expected_ids;
# TODO Run more queries to prevent flakiness
sub test_recall
{
- my ($min) = @_;
+ my ($probes, $min) = @_;
- my $actual = $node->safe_psql("postgres", "SELECT i FROM tst ORDER BY v <-> '[0.5,0.5,0.5]' LIMIT 10;");
+ my $actual = $node->safe_psql("postgres", qq(
+SET enable_seqscan = off;
+SET ivfflat.probes = $probes;
+SELECT i FROM tst ORDER BY v <-> '[0.5,0.5,0.5]' LIMIT 10;
+));
my @actual_ids = split("\n", $actual);
my %actual_set = map { $_ => 1 } @actual_ids;
@@ -46,9 +50,7 @@ my $expected = $node->safe_psql("postgres", "SELECT i FROM tst ORDER BY v <-> '[
$node->safe_psql("postgres", "CREATE INDEX ON tst USING ivfflat (v);");
# Test approximate results
-$node->safe_psql("postgres", "SET enable_seqscan = off;");
-test_recall(5);
+test_recall(1, 5);
# Test probes
-$node->safe_psql("postgres", "SET ivfflat.probes = 100");
-test_recall(10);
+test_recall(100, 10);
[parent: 062e2209369e]