14
14
15
15
sub test_recall
16
16
{
17
- my ($c ,$ef_search ,$min ,$operator ) =@_ ;
17
+ my ($c ,$ef_search ,$min ,$operator , $mode ) =@_ ;
18
18
my $correct = 0;
19
19
my $total = 0;
20
20
21
21
my $explain =$node -> safe_psql(" postgres" ,qq(
22
22
SET enable_seqscan = off;
23
23
SET hnsw.ef_search =$ef_search ;
24
- SET hnsw.iterative_search =relaxed_order ;
24
+ SET hnsw.iterative_search =$mode ;
25
25
EXPLAIN ANALYZE SELECT i FROM tst WHERE i %$c = 0 ORDER BY v$operator '$queries [0]' LIMIT$limit ;
26
26
) );
27
27
like($explain ,qr / Index Scan using idx on tst/ );
@@ -31,7 +31,7 @@ sub test_recall
31
31
my $actual =$node -> safe_psql(" postgres" ,qq(
32
32
SET enable_seqscan = off;
33
33
SET hnsw.ef_search =$ef_search ;
34
- SET hnsw.iterative_search =relaxed_order ;
34
+ SET hnsw.iterative_search =$mode ;
35
35
SELECT i FROM tst WHERE i %$c = 0 ORDER BY v$operator '$queries [$i ]' LIMIT$limit ;
36
36
) );
37
37
my @actual_ids =split (" \n " ,$actual );
@@ -108,21 +108,8 @@ sub test_recall
108
108
push (@expected ,$res );
109
109
}
110
110
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" );
126
113
}
127
114
128
115
$node -> safe_psql(" postgres" ," DROP INDEX idx;" );