Skip to content

Commit

Permalink
trying to stabilize floating-point tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvova committed Sep 14, 2024
1 parent 3dfcefb commit 70ff3b6
Show file tree
Hide file tree
Showing 4 changed files with 179 additions and 158 deletions.
276 changes: 138 additions & 138 deletions mysql-test/main/vector.result
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ id hex(v)
flush tables;
select id,vec_distance_euclidean(v, x'B047263c9f87233fcfd27e3eae493e3f0329f43e') d from t1 order by d limit 3;
id d
9 0.47199761867523193
10 0.5069010853767395
3 0.5865673422813416
9 0.47199
10 0.50690
3 0.58656
select id,vec_distance_euclidean(x'b047263C9f87233fcfd27e3eae493e3f0329f43e', v) d from t1 order by d limit 3;
id d
9 0.47199761867523193
10 0.5069010853767395
3 0.5865673422813416
9 0.47199
10 0.50690
3 0.58656
select id>0,vec_distance_euclidean(v, NULL) d from t1 order by d limit 3;
id>0 d
1 NULL
Expand All @@ -138,149 +138,149 @@ id1 id2 vec_distance_euclidean(t1.v, t2.v)
8 8 0
9 9 0
10 10 0
7 10 0.35209009051322937
10 7 0.35209009051322937
1 7 0.5572673082351685
7 1 0.5572673082351685
2 3 0.6065129041671753
3 2 0.6065129041671753
1 3 0.6128237843513489
3 1 0.6128237843513489
5 8 0.6219995617866516
8 5 0.6219995617866516
3 10 0.65231853723526
10 3 0.65231853723526
9 10 0.6732681393623352
10 9 0.6732681393623352
3 7 0.679989218711853
7 3 0.679989218711853
3 9 0.6820752024650574
9 3 0.6820752024650574
2 10 0.6916305422782898
10 2 0.6916305422782898
2 9 0.6966650485992432
9 2 0.6966650485992432
3 6 0.7102823853492737
6 3 0.7102823853492737
2 7 0.7120217680931091
7 2 0.7120217680931091
2 6 0.7351617813110352
6 2 0.7351617813110352
1 10 0.7386864423751831
10 1 0.7386864423751831
4 6 0.7784357666969299
6 4 0.7784357666969299
4 8 0.779583752155304
8 4 0.779583752155304
4 5 0.8132007122039795
5 4 0.8132007122039795
2 4 0.826092541217804
4 2 0.826092541217804
5 10 0.8286488652229309
10 5 0.8286488652229309
5 9 0.8769351243972778
9 5 0.8769351243972778
1 6 0.8861410617828369
6 1 0.8861410617828369
3 5 0.9224202036857605
5 3 0.9224202036857605
4 7 0.934791624546051
7 4 0.934791624546051
7 9 0.9364253282546997
9 7 0.9364253282546997
3 4 0.9757105708122253
4 3 0.9757105708122253
1 2 0.9810272455215454
2 1 0.9810272455215454
1 4 0.9965475797653198
4 1 0.9965475797653198
5 7 0.9976863861083984
7 5 0.9976863861083984
4 10 1.010934591293335
10 4 1.010934591293335
1 5 1.0208359956741333
5 1 1.0208359956741333
6 7 1.022133231163025
7 6 1.022133231163025
2 5 1.050769329071045
5 2 1.050769329071045
6 8 1.103420376777649
8 6 1.103420376777649
3 8 1.1170300245285034
8 3 1.1170300245285034
6 10 1.1523451805114746
10 6 1.1523451805114746
1 9 1.163775086402893
9 1 1.163775086402893
2 8 1.1736570596694946
8 2 1.1736570596694946
4 9 1.1746894121170044
9 4 1.1746894121170044
1 8 1.1909960508346558
8 1 1.1909960508346558
8 10 1.2093596458435059
10 8 1.2093596458435059
6 9 1.2145298719406128
9 6 1.2145298719406128
5 6 1.2272785902023315
6 5 1.2272785902023315
8 9 1.2575258016586304
9 8 1.2575258016586304
7 8 1.288239598274231
8 7 1.288239598274231
7 10 0.35209
10 7 0.35209
1 7 0.55726
7 1 0.55726
2 3 0.60651
3 2 0.60651
1 3 0.61282
3 1 0.61282
5 8 0.62199
8 5 0.62199
3 10 0.65231
10 3 0.65231
9 10 0.67326
10 9 0.67326
3 7 0.67998
7 3 0.67998
3 9 0.68207
9 3 0.68207
2 10 0.69163
10 2 0.69163
2 9 0.69666
9 2 0.69666
3 6 0.71028
6 3 0.71028
2 7 0.71202
7 2 0.71202
2 6 0.73516
6 2 0.73516
1 10 0.73868
10 1 0.73868
4 6 0.77843
6 4 0.77843
4 8 0.77958
8 4 0.77958
4 5 0.81320
5 4 0.81320
2 4 0.82609
4 2 0.82609
5 10 0.82864
10 5 0.82864
5 9 0.87693
9 5 0.87693
1 6 0.88614
6 1 0.88614
3 5 0.92242
5 3 0.92242
4 7 0.93479
7 4 0.93479
7 9 0.93642
9 7 0.93642
3 4 0.97571
4 3 0.97571
1 2 0.98102
2 1 0.98102
1 4 0.99654
4 1 0.99654
5 7 0.99768
7 5 0.99768
4 10 1.01093
10 4 1.01093
1 5 1.02083
5 1 1.02083
6 7 1.02213
7 6 1.02213
2 5 1.05076
5 2 1.05076
6 8 1.10342
8 6 1.10342
3 8 1.11703
8 3 1.11703
6 10 1.15234
10 6 1.15234
1 9 1.16377
9 1 1.16377
2 8 1.17365
8 2 1.17365
4 9 1.17468
9 4 1.17468
1 8 1.19099
8 1 1.19099
8 10 1.20935
10 8 1.20935
6 9 1.21452
9 6 1.21452
5 6 1.22727
6 5 1.22727
8 9 1.25752
9 8 1.25752
7 8 1.28823
8 7 1.28823
flush session status;
select id,vec_distance_euclidean(v, x'B047263c9f87233fcfd27e3eae493e3f0329f43e') d from t1 order by d limit 3;
id d
9 0.47199761867523193
10 0.5069010853767395
3 0.5865673422813416
9 0.47199
10 0.50690
3 0.58656
show status like 'handler_read_rnd_next';
Variable_name Value
Handler_read_rnd_next 0
select id,vec_distance_euclidean(v, x'B047263c9f87233fcfd27e3eae493e3f0329f43e') d from t1 use index () order by d limit 3;
id d
9 0.47199761867523193
10 0.5069010853767395
3 0.5865673422813416
9 0.47199
10 0.50690
3 0.58656
show status like 'handler_read_rnd_next';
Variable_name Value
Handler_read_rnd_next 11
flush session status;
select id,vec_distance_cosine(v, x'B047263c9f87233fcfd27e3eae493e3f0329f43e') d from t1 order by d limit 3;
id d
10 0.059055447578430176
9 0.06546902656555176
3 0.10750287771224976
10 0.05905
9 0.06546
3 0.10750
show status like 'handler_read_rnd_next';
Variable_name Value
Handler_read_rnd_next 11
delete from t1 where v = x'7b713f3e5258323f80d1113d673b2b3f66e3583f';
select id,vec_distance_euclidean(v, x'B047263C9f87233fcfd27e3eae493e3f0329f43e') d from t1 order by d limit 3;
id d
10 0.5069010853767395
3 0.5865673422813416
7 0.7344464659690857
10 0.50690
3 0.58656
7 0.73444
insert t1 (v) values (x'7b713f3e5258323f80d1113d673b2b3f66e3583f');
select id,vec_distance_euclidean(v, x'b047263c9F87233fcfd27e3eae493e3f0329f43e') d from t1 order by d limit 3;
id d
11 0.47199761867523193
10 0.5069010853767395
3 0.5865673422813416
11 0.47199
10 0.50690
3 0.58656
select id,vec_distance_euclidean(v, x'B047263c9F87233fcfd27e3eae493e3f0329f43e') d from t1 order by d limit 5;
id d
11 0.47199761867523193
10 0.5069010853767395
3 0.5865673422813416
7 0.7344464659690857
5 0.7671033143997192
11 0.47199
10 0.50690
3 0.58656
7 0.73444
5 0.76710
update t1 set v=x'76EDFC3E4B57243F10F8423FB158713F020BAA3E' where v=x'6CA1D43E9DF91B3FE580DA3E1C247D3F147CF33E';
select id,vec_distance_euclidean(v, x'B047263C9F87233fcfd27e3eae493e3f0329f43e') d from t1 order by d limit 5;
id d
11 0.47199761867523193
3 0.5865673422813416
7 0.7344464659690857
10 0.7468367218971252
5 0.7671033143997192
11 0.47199
3 0.58656
7 0.73444
10 0.74683
5 0.76710
delete from t1;
insert t1 (v) values (x'e360d63ebe554f3fcdbc523f4522193f5236083d'),
(x'f511303f72224a3fdd05fe3eb22a133ffae86a3f'),
Expand All @@ -294,11 +294,11 @@ insert t1 (v) values (x'e360d63ebe554f3fcdbc523f4522193f5236083d'),
(x'6ca1d43e9df91b3fe580da3e1c247d3f147cf33e');
select id,vec_distance_euclidean(v, x'b047263c9f87233Fcfd27e3eae493e3f0329f43e') d from t1 order by d limit 5;
id d
20 0.47199761867523193
21 0.5069010853767395
14 0.5865673422813416
18 0.7344464659690857
16 0.7671033143997192
20 0.47199
21 0.50690
14 0.58656
18 0.73444
16 0.76710
insert t1 (v) values ('');
ERROR 22007: Incorrect vector value: '...' for column `test`.`t1`.`v` at row 1
insert t1 (v) values (x'1234');
Expand Down Expand Up @@ -426,32 +426,32 @@ insert t1 (v) values (x'e360d63ebe554f3fcdbc523f4522193f5236083d'),
(x'6ca1d43e9df91b3fe580da3e1c247d3f147cf33e');
select id,vec_distance_cosine(v, x'B047263c9f87233fcfd27e3eae493e3f0329f43e') d from t1 order by d limit 3;
id d
10 0.059055447578430176
9 0.06546902656555176
3 0.10750287771224976
10 0.05905
9 0.06546
3 0.10750
flush session status;
select id,vec_distance_cosine(v, x'B047263c9f87233fcfd27e3eae493e3f0329f43e') d from t1 order by d limit 3;
id d
10 0.059055447578430176
9 0.06546902656555176
3 0.10750287771224976
10 0.05905
9 0.06546
3 0.10750
show status like 'handler_read_rnd_next';
Variable_name Value
Handler_read_rnd_next 0
select id,vec_distance_cosine(v, x'B047263c9f87233fcfd27e3eae493e3f0329f43e') d from t1 use index () order by d limit 3;
id d
10 0.059055447578430176
9 0.06546902656555176
3 0.10750287771224976
10 0.05905
9 0.06546
3 0.10750
show status like 'handler_read_rnd_next';
Variable_name Value
Handler_read_rnd_next 11
flush session status;
select id,vec_distance_euclidean(v, x'B047263c9f87233fcfd27e3eae493e3f0329f43e') d from t1 order by d limit 3;
id d
9 0.47199761867523193
10 0.5069010853767395
3 0.5865673422813416
9 0.47199
10 0.50690
3 0.58656
show status like 'handler_read_rnd_next';
Variable_name Value
Handler_read_rnd_next 11
Expand Down
Loading

0 comments on commit 70ff3b6

Please sign in to comment.