8000 Added test for strict order [skip ci] · postgrespro/pgvector@7f735eb · GitHub
[go: up one dir, main page]

Skip to content

Commit 7f735eb

Browse files
committed
Added test for strict order [skip ci]
1 parent 02b01e1 commit 7f735eb

File tree

1 file changed

+5
-18
lines changed

1 file changed

+5
-18
lines changed

test/t/044_hnsw_iterative_search_recall.pl

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414

1515
sub test_recall
1616
{
17-
my ($c, $ef_search, $min, $operator) = @_;
17+
my ($c, $ef_search, $min, $operator, $mode) = @_;
1818
my $correct = 0;
1919
my $total = 0;
2020

2121
my $explain = $node->safe_psql("postgres", qq(
2222
SET enable_seqscan = off;
2323
SET hnsw.ef_search = $ef_search;
24-
SET hnsw.iterative_search = relaxed_order;
24+
SET hnsw.iterative_search = $mode;
2525
EXPLAIN ANALYZE SELECT i FROM tst WHERE i % $c = 0 ORDER BY v $operator '$queries[0]' LIMIT $limit;
2626
));
2727
like($explain, qr/Index Scan using idx on tst/);
@@ -31,7 +31,7 @@ sub test_recall
3131
my $actual = $node->safe_psql("postgres", qq(
3232
SET enable_seqscan = off;
3333
SET hnsw.ef_search = $ef_search;
34-
SET hnsw.iterative_search = relaxed_order;
34+
SET hnsw.iterative_search = $mode;
3535
SELECT i FROM tst WHERE i % $c = 0 ORDER BY v $operator '$queries[$i]' LIMIT $limit;
3636
));
3737
my @actual_ids = split("\n", $actual);
@@ -108,21 +108,8 @@ sub test_recall
108108
push(@expected, $res);
109109
}
110110

111-
if ($c == 100)
112-
{
113-
test_recall($c, 40, 0.99, $operator);
114-
}
115-
else
116-
{
117-
if ($operator eq "<->")
118-
{
119-
test_recall($c, 40, 0.99, $operator);
120-
}
121-
else
122-
{
123-
test_recall($c, 40, 0.99, $operator);
124-
}
125-
}
111+
test_recall($c, 40, 0.99, $operator, "strict_order");
112+
test_recall($c, 40, 0.99, $operator, "relaxed_order");
126113
}
127114

128115
$node->safe_psql("postgres", "DROP INDEX idx;");

0 commit comments

Comments
 (0)
0