github.com/matrixorigin/matrixone@v1.2.0/test/distributed/cases/array/array_index.result (about) 1 drop database if exists vecdb2; 2 create database vecdb2; 3 use vecdb2; 4 SET GLOBAL experimental_ivf_index = 1; 5 drop table if exists t1; 6 create table t1(a int primary key,b vecf32(3), c vecf64(5)); 7 insert into t1 values(1, "[1,2,3]" , "[1,2,3,4,5"); 8 internal error: malformed vector input: [1,2,3,4,5 9 insert into t1 values(2, "[1,2,4]", "[1,2,4,4,5]"); 10 insert into t1 values(3, "[1,2.4,4]", "[1,2.4,4,4,5]"); 11 insert into t1 values(4, "[1,2,5]", "[1,2,5,4,5]"); 12 insert into t1 values(5, "[1,3,5]", "[1,3,5,4,5]"); 13 insert into t1 values(6, "[100,44,50]", "[100,44,50,60,70]"); 14 insert into t1 values(7, "[120,50,70]", "[120,50,70,80,90]"); 15 insert into t1 values(8, "[130,40,90]", "[130,40,90,100,110]"); 16 select a,b,normalize_l2(b) from t1; 17 a b normalize_l2(b) 18 2 [1, 2, 4] [0.2182179, 0.4364358, 0.8728716] 19 3 [1, 2.4, 4] [0.20961091, 0.5030662, 0.83844364] 20 4 [1, 2, 5] [0.18257418, 0.36514837, 0.91287094] 21 5 [1, 3, 5] [0.16903085, 0.50709254, 0.8451542] 22 6 [100, 44, 50] [0.8322936, 0.36620918, 0.4161468] 23 7 [120, 50, 70] [0.81274253, 0.33864272, 0.4740998] 24 8 [130, 40, 90] [0.7970811, 0.24525574, 0.5518254] 25 select cluster_centers(b kmeans '2,vector_l2_ops') from t1; 26 cluster_centers(b, 2,vector_l2_ops) 27 [ [116.666664, 44.666668, 70],[1, 2.35, 4.5] ] 28 select cluster_centers(b kmeans '2,vector_ip_ops') from t1; 29 internal error: unsupported distance_type 'vector_ip_ops' for cluster_centers 30 select cluster_centers(b kmeans '2,vector_cosine_ops') from t1; 31 internal error: unsupported distance_type 'vector_cosine_ops' for cluster_centers 32 SELECT value FROM (SELECT cluster_centers(b kmeans '2,vector_l2_ops,kmeansplusplus,false') AS centers FROM t1) AS subquery CROSS JOIN UNNEST(subquery.centers) AS u; 33 value 34 [116.666664, 44.666668, 70] 35 [1, 2.35, 4.5] 36 SELECT value FROM (SELECT cluster_centers(b kmeans '2,vector_l2_ops,kmeansplusplus,true') AS centers FROM t1) AS subquery CROSS JOIN UNNEST(subquery.centers) AS u; 37 value 38 [0.8140391, 0.31670254, 0.4806907] 39 [0.19485846, 0.45293573, 0.8673351] 40 select a,c,normalize_l2(c) from t1; 41 a c normalize_l2(c) 42 2 [1, 2, 4, 4, 5] [0.1270001270001905, 0.254000254000381, 0.508000508000762, 0.508000508000762, 0.6350006350009525] 43 3 [1, 2.4, 4, 4, 5] [0.12523503624640608, 0.3005640869913746, 0.5009401449856243, 0.5009401449856243, 0.6261751812320304] 44 4 [1, 2, 5, 4, 5] [0.11867816581938533, 0.23735633163877065, 0.5933908290969266, 0.4747126632775413, 0.5933908290969266] 45 5 [1, 3, 5, 4, 5] [0.11470786693528087, 0.3441236008058426, 0.5735393346764044, 0.4588314677411235, 0.5735393346764044] 46 6 [100, 44, 50, 60, 70] [0.6602997913373754, 0.29053190818844515, 0.3301498956686877, 0.3961798748024252, 0.46220985393616276] 47 7 [120, 50, 70, 80, 90] [0.6298366572977736, 0.262431940540739, 0.3674047167570346, 0.4198911048651824, 0.4723774929733302] 48 8 [130, 40, 90, 100, 110] [0.5890862307582768, 0.18125730177177748, 0.40782892898649936, 0.45314325442944375, 0.4984575798723881] 49 select cluster_centers(c kmeans '2,vector_l2_ops') from t1; 50 cluster_centers(c, 2,vector_l2_ops) 51 [ [116.66666666666666, 44.666666666666664, 70, 80, 90],[1, 2.35, 4.5, 4, 5] ] 52 select cluster_centers(c kmeans '2,vector_ip_ops') from t1; 53 internal error: unsupported distance_type 'vector_ip_ops' for cluster_centers 54 select cluster_centers(c kmeans '2,vector_cosine_ops') from t1; 55 internal error: unsupported distance_type 'vector_cosine_ops' for cluster_centers 56 SELECT value FROM (SELECT cluster_centers(c kmeans '2,vector_l2_ops') AS centers FROM t1) AS subquery CROSS JOIN UNNEST(subquery.centers) AS u; 57 value 58 [116.66666666666666, 44.666666666666664, 70, 80, 90] 59 [1, 2.35, 4.5, 4, 5] 60 SELECT value FROM (SELECT cluster_centers(c kmeans '2,vector_l2_ops,kmeansplusplus,true') AS centers FROM t1) AS subquery CROSS JOIN UNNEST(subquery.centers) AS u; 61 value 62 [0.6264075597978086, 0.24474038350032057, 0.3684611804707405, 0.42307141136568377, 0.477681642260627] 63 [0.1214052990003157, 0.28401106835909223, 0.5439677041899293, 0.4856211960012628, 0.6070264950015785] 64 drop table if exists tbl; 65 create table tbl(id int primary key, embedding vecf32(3)); 66 insert into tbl values(1, "[1,2,3]"); 67 insert into tbl values(2, "[1,2,4]"); 68 insert into tbl values(3, "[1,2.4,4]"); 69 insert into tbl values(4, "[1,2,5]"); 70 insert into tbl values(5, "[1,3,5]"); 71 insert into tbl values(6, "[100,44,50]"); 72 insert into tbl values(7, "[120,50,70]"); 73 insert into tbl values(8, "[130,40,90]"); 74 create index idx1 using IVFFLAT on tbl(embedding) lists = 2 op_type 'vector_l2_ops'; 75 show index from tbl; 76 Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression 77 tbl 0 PRIMARY 1 id A 0 NULL NULL YES NULL 78 tbl 1 idx1 1 embedding A 0 NULL NULL YES ivfflat {"lists":"2","op_type":"vector_l2_ops"} YES NULL 79 show create table tbl; 80 Table Create Table 81 tbl CREATE TABLE `tbl` (\n`id` INT NOT NULL,\n`embedding` VECF32(3) DEFAULT NULL,\nPRIMARY KEY (`id`),\nKEY `idx1` USING ivfflat (`embedding`) lists = 2 op_type 'vector_l2_ops' \n) 82 select name, type, column_name, algo, algo_table_type,algo_params from mo_catalog.mo_indexes where name="idx1"; 83 name type column_name algo algo_table_type algo_params 84 idx1 MULTIPLE embedding ivfflat metadata {"lists":"2","op_type":"vector_l2_ops"} 85 idx1 MULTIPLE embedding ivfflat centroids {"lists":"2","op_type":"vector_l2_ops"} 86 idx1 MULTIPLE embedding ivfflat entries {"lists":"2","op_type":"vector_l2_ops"} 87 alter table tbl alter reindex idx1 ivfflat lists=3; 88 show index from tbl; 89 Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression 90 tbl 0 PRIMARY 1 id A 0 NULL NULL YES NULL 91 tbl 1 idx1 1 embedding A 0 NULL NULL YES ivfflat {"lists":"3","op_type":"vector_l2_ops"} YES NULL 92 show create table tbl; 93 Table Create Table 94 tbl CREATE TABLE `tbl` (\n`id` INT NOT NULL,\n`embedding` VECF32(3) DEFAULT NULL,\nPRIMARY KEY (`id`),\nKEY `idx1` USING ivfflat (`embedding`) lists = 3 op_type 'vector_l2_ops' \n) 95 select name, type, column_name, algo, algo_table_type,algo_params from mo_catalog.mo_indexes where name="idx1"; 96 name type column_name algo algo_table_type algo_params 97 idx1 MULTIPLE embedding ivfflat metadata {"lists":"3","op_type":"vector_l2_ops"} 98 idx1 MULTIPLE embedding ivfflat centroids {"lists":"3","op_type":"vector_l2_ops"} 99 idx1 MULTIPLE embedding ivfflat entries {"lists":"3","op_type":"vector_l2_ops"} 100 alter table tbl add c vecf32(3); 101 show index from tbl; 102 Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression 103 tbl 1 idx1 1 embedding A 0 NULL NULL YES ivfflat {"lists":"3","op_type":"vector_l2_ops"} YES NULL 104 tbl 0 PRIMARY 1 id A 0 NULL NULL YES NULL 105 show create table tbl; 106 Table Create Table 107 tbl CREATE TABLE `tbl` (\n`id` INT NOT NULL,\n`embedding` VECF32(3) DEFAULT NULL,\n`c` VECF32(3) DEFAULT NULL,\nPRIMARY KEY (`id`),\nKEY `idx1` USING ivfflat (`embedding`) lists = 3 op_type 'vector_l2_ops' \n) 108 select name, type, column_name, algo, algo_table_type,algo_params from mo_catalog.mo_indexes where name="idx1"; 109 name type column_name algo algo_table_type algo_params 110 idx1 MULTIPLE embedding ivfflat metadata {"lists":"3","op_type":"vector_l2_ops"} 111 idx1 MULTIPLE embedding ivfflat centroids {"lists":"3","op_type":"vector_l2_ops"} 112 idx1 MULTIPLE embedding ivfflat entries {"lists":"3","op_type":"vector_l2_ops"} 113 drop table if exists tbl; 114 create table tbl(a int primary key,b vecf32(3), c vecf64(5)); 115 create index idx2 using IVFFLAT on tbl(b) lists = 2 op_type 'vector_l2_ops'; 116 show index from tbl; 117 Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression 118 tbl 0 PRIMARY 1 a A 0 NULL NULL YES NULL 119 tbl 1 idx2 1 b A 0 NULL NULL YES ivfflat {"lists":"2","op_type":"vector_l2_ops"} YES NULL 120 show create table tbl; 121 Table Create Table 122 tbl CREATE TABLE `tbl` (\n`a` INT NOT NULL,\n`b` VECF32(3) DEFAULT NULL,\n`c` VECF64(5) DEFAULT NULL,\nPRIMARY KEY (`a`),\nKEY `idx2` USING ivfflat (`b`) lists = 2 op_type 'vector_l2_ops' \n) 123 select name, type, column_name, algo, algo_table_type,algo_params from mo_catalog.mo_indexes where name="idx2"; 124 name type column_name algo algo_table_type algo_params 125 idx2 MULTIPLE b ivfflat metadata {"lists":"2","op_type":"vector_l2_ops"} 126 idx2 MULTIPLE b ivfflat centroids {"lists":"2","op_type":"vector_l2_ops"} 127 idx2 MULTIPLE b ivfflat entries {"lists":"2","op_type":"vector_l2_ops"} 128 drop table if exists tbl; 129 create table tbl(a int primary key,b vecf32(3), c vecf32(3)); 130 insert into tbl values(1, "[1,2,3]","[1,2,3]"); 131 insert into tbl values(2, "[1,2,4]","[1,2,4]"); 132 insert into tbl values(3, "[1,2.4,4]","[1,2.4,4]"); 133 insert into tbl values(4, "[1,2,5]","[1,2,5]"); 134 create index idx3 using IVFFLAT on tbl(a) lists = 2 op_type 'vector_l2_ops'; 135 not supported: IVFFLAT only supports VECFXX column types 136 create index idx4 using IVFFLAT on tbl(b,c) lists = 2 op_type 'vector_l2_ops'; 137 not supported: don't support multi column IVF vector index 138 create index idx5 using IVFFLAT on tbl(b) lists = -1; 139 SQL parser error: You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. syntax error at line 1 column 51 near " -1;"; 140 create index idx6 using IVFFLAT on tbl(b) lists = 1 op_type 'vector_l1_ops'; 141 internal error: invalid op_type. not of type 'vector_l2_ops' 142 drop table if exists tbl; 143 create table tbl(a int primary key,b vecf32(3), c vecf32(3)); 144 insert into tbl values(1, "[1,2,3]","[1,2,3]"); 145 insert into tbl values(2, "[1,2,4]","[1,2,4]"); 146 insert into tbl values(3, "[1,2.4,4]","[1,2.4,4]"); 147 insert into tbl values(4, "[1,2,5]","[1,2,5]"); 148 create index idx7 using IVFFLAT on tbl(b); 149 drop table if exists tbl; 150 create table tbl(a int primary key, b vecf32(3)); 151 insert into tbl values(1, "[1,2,3]"); 152 insert into tbl values(2, "[1,2,4]"); 153 insert into tbl values(3, "[1,2.4,4]"); 154 insert into tbl values(4, "[1,2,5]"); 155 insert into tbl values(5, "[1,3,5]"); 156 insert into tbl values(6, "[100,44,50]"); -- dup 157 insert into tbl values(7, "[100,44,50]"); 158 insert into tbl values(8, "[130,40,90]"); 159 create index idx8 using IVFFLAT on tbl(b) lists = 2 op_type 'vector_l2_ops'; 160 show index from tbl; 161 Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression 162 tbl 0 PRIMARY 1 a A 0 NULL NULL YES NULL 163 tbl 1 idx8 1 b A 0 NULL NULL YES ivfflat {"lists":"2","op_type":"vector_l2_ops"} YES NULL 164 show create table tbl; 165 Table Create Table 166 tbl CREATE TABLE `tbl` (\n`a` INT NOT NULL,\n`b` VECF32(3) DEFAULT NULL,\nPRIMARY KEY (`a`),\nKEY `idx8` USING ivfflat (`b`) lists = 2 op_type 'vector_l2_ops' \n) 167 select name, type, column_name, algo, algo_table_type,algo_params from mo_catalog.mo_indexes where name="idx8"; 168 name type column_name algo algo_table_type algo_params 169 idx8 MULTIPLE b ivfflat metadata {"lists":"2","op_type":"vector_l2_ops"} 170 idx8 MULTIPLE b ivfflat centroids {"lists":"2","op_type":"vector_l2_ops"} 171 idx8 MULTIPLE b ivfflat entries {"lists":"2","op_type":"vector_l2_ops"} 172 drop table if exists tbl; 173 create table tbl(a int primary key, b vecf32(3), index idx9 using ivfflat (b)); 174 drop table if exists tbl; 175 create table tbl(a int primary key, b vecf32(3), index idx10 using ivfflat (b)); 176 insert into tbl values(1, "[1,2,3]"); 177 insert into tbl values(2, "[1,2,4]"); 178 show index from tbl; 179 Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression 180 tbl 1 idx10 1 b A 0 NULL NULL YES ivfflat {"lists":"1","op_type":"vector_l2_ops"} YES NULL 181 tbl 0 PRIMARY 1 a A 0 NULL NULL YES NULL 182 show create table tbl; 183 Table Create Table 184 tbl CREATE TABLE `tbl` (\n`a` INT NOT NULL,\n`b` VECF32(3) DEFAULT NULL,\nPRIMARY KEY (`a`),\nKEY `idx10` USING ivfflat (`b`) lists = 1 op_type 'vector_l2_ops' \n) 185 select name, type, column_name, algo, algo_table_type,algo_params from mo_catalog.mo_indexes where name="idx10"; 186 name type column_name algo algo_table_type algo_params 187 idx10 MULTIPLE b ivfflat metadata {"lists":"1","op_type":"vector_l2_ops"} 188 idx10 MULTIPLE b ivfflat centroids {"lists":"1","op_type":"vector_l2_ops"} 189 idx10 MULTIPLE b ivfflat entries {"lists":"1","op_type":"vector_l2_ops"} 190 alter table tbl drop column b; 191 show index from tbl; 192 Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression 193 tbl 0 PRIMARY 1 a A 0 NULL NULL YES NULL 194 show create table tbl; 195 Table Create Table 196 tbl CREATE TABLE `tbl` (\n`a` INT NOT NULL,\nPRIMARY KEY (`a`)\n) 197 select name, type, column_name, algo, algo_table_type,algo_params from mo_catalog.mo_indexes where name="idx10"; 198 name type column_name algo algo_table_type algo_params 199 drop table if exists tbl; 200 create table tbl(a int primary key, b vecf32(3), index idx11 using ivfflat (b)); 201 insert into tbl values(1, "[1,2,3]"); 202 insert into tbl values(2, "[1,2,4]"); 203 show index from tbl; 204 Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression 205 tbl 1 idx11 1 b A 0 NULL NULL YES ivfflat {"lists":"1","op_type":"vector_l2_ops"} YES NULL 206 tbl 0 PRIMARY 1 a A 0 NULL NULL YES NULL 207 show create table tbl; 208 Table Create Table 209 tbl CREATE TABLE `tbl` (\n`a` INT NOT NULL,\n`b` VECF32(3) DEFAULT NULL,\nPRIMARY KEY (`a`),\nKEY `idx11` USING ivfflat (`b`) lists = 1 op_type 'vector_l2_ops' \n) 210 select name, type, column_name, algo, algo_table_type,algo_params from mo_catalog.mo_indexes where name="idx11"; 211 name type column_name algo algo_table_type algo_params 212 idx11 MULTIPLE b ivfflat metadata {"lists":"1","op_type":"vector_l2_ops"} 213 idx11 MULTIPLE b ivfflat centroids {"lists":"1","op_type":"vector_l2_ops"} 214 idx11 MULTIPLE b ivfflat entries {"lists":"1","op_type":"vector_l2_ops"} 215 alter table tbl drop index idx11; 216 show index from tbl; 217 Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression 218 tbl 0 PRIMARY 1 a A 0 NULL NULL YES NULL 219 show create table tbl; 220 Table Create Table 221 tbl CREATE TABLE `tbl` (\n`a` INT NOT NULL,\n`b` VECF32(3) DEFAULT NULL,\nPRIMARY KEY (`a`)\n) 222 select name, type, column_name, algo, algo_table_type,algo_params from mo_catalog.mo_indexes where name="idx11"; 223 name type column_name algo algo_table_type algo_params 224 drop table if exists tbl; 225 create table tbl(id int primary key, embedding vecf32(3)); 226 insert into tbl values(1, "[1,2,3]"); 227 insert into tbl values(2, "[1,2,4]"); 228 insert into tbl values(3, "[1,2.4,4]"); 229 insert into tbl values(4, "[1,2,5]"); 230 insert into tbl values(5, "[1,3,5]"); 231 insert into tbl values(6, "[100,44,50]"); 232 insert into tbl values(7, "[120,50,70]"); 233 insert into tbl values(8, "[130,40,90]"); 234 create index idx12 using ivfflat on tbl(embedding) lists=2 op_type "vector_l2_ops"; 235 show index from tbl; 236 Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression 237 tbl 0 PRIMARY 1 id A 0 NULL NULL YES NULL 238 tbl 1 idx12 1 embedding A 0 NULL NULL YES ivfflat {"lists":"2","op_type":"vector_l2_ops"} YES NULL 239 show create table tbl; 240 Table Create Table 241 tbl CREATE TABLE `tbl` (\n`id` INT NOT NULL,\n`embedding` VECF32(3) DEFAULT NULL,\nPRIMARY KEY (`id`),\nKEY `idx12` USING ivfflat (`embedding`) lists = 2 op_type 'vector_l2_ops' \n) 242 insert into tbl values(15, "[1,3,5]"); -- inserted to centroid 1 of version 0 243 insert into tbl values(18, "[130,40,90]"); -- inserted to centroid 2 of version 0 244 alter table tbl alter reindex idx12 ivfflat lists=2; 245 insert into tbl values(25, "[2,4,5]"); -- inserted to cluster 1 of version 1 246 insert into tbl values(28, "[131,41,91]"); -- inserted to cluster 2 of version 1 247 drop table if exists tbl; 248 create table tbl(id int, age int, embedding vecf32(3), primary key(id, age)); 249 insert into tbl values(1, 10, "[1,2,3]"); 250 insert into tbl values(2, 20, "[1,2,4]"); 251 insert into tbl values(3, 30, "[1,2.4,4]"); 252 insert into tbl values(4, 40, "[1,2,5]"); 253 insert into tbl values(5, 50, "[1,3,5]"); 254 insert into tbl values(6, 60, "[100,44,50]"); 255 insert into tbl values(7, 70, "[120,50,70]"); 256 insert into tbl values(8, 80, "[130,40,90]"); 257 create index idx13 using ivfflat on tbl(embedding) lists=2 op_type "vector_l2_ops"; 258 show index from tbl; 259 Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression 260 tbl 0 PRIMARY 1 id A 0 NULL NULL YES NULL 261 tbl 0 PRIMARY 2 age A 0 NULL NULL YES NULL 262 tbl 1 idx13 1 embedding A 0 NULL NULL YES ivfflat {"lists":"2","op_type":"vector_l2_ops"} YES NULL 263 show create table tbl; 264 Table Create Table 265 tbl CREATE TABLE `tbl` (\n`id` INT NOT NULL,\n`age` INT NOT NULL,\n`embedding` VECF32(3) DEFAULT NULL,\nPRIMARY KEY (`id`,`age`),\nKEY `idx13` USING ivfflat (`embedding`) lists = 2 op_type 'vector_l2_ops' \n) 266 insert into tbl values(15, 90, "[1,3,5]"); -- inserted to centroid 1 of version 0 267 insert into tbl values(18, 100, "[130,40,90]"); -- inserted to centroid 2 of version 0 268 alter table tbl alter reindex idx13 ivfflat lists=2; 269 insert into tbl values(25, 110, "[2,4,5]"); -- inserted to cluster 1 of version 1 270 insert into tbl values(28, 120, "[131,41,91]"); -- inserted to cluster 2 of version 1 271 drop table if exists tbl; 272 create table tbl(id int, embedding vecf32(3)); 273 insert into tbl values(1, "[1,2,3]"); 274 insert into tbl values(2, "[1,2,4]"); 275 insert into tbl values(3, "[1,2.4,4]"); 276 insert into tbl values(4, "[1,2,5]"); 277 insert into tbl values(5, "[1,3,5]"); 278 insert into tbl values(6, "[100,44,50]"); 279 insert into tbl values(7, "[120,50,70]"); 280 insert into tbl values(8, "[130,40,90]"); 281 create index idx14 using ivfflat on tbl(embedding) lists=2 op_type "vector_l2_ops"; 282 show index from tbl; 283 Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment Index_params Visible Expression 284 tbl 1 idx14 1 embedding A 0 NULL NULL YES ivfflat {"lists":"2","op_type":"vector_l2_ops"} YES NULL 285 show create table tbl; 286 Table Create Table 287 tbl CREATE TABLE `tbl` (\n`id` INT DEFAULT NULL,\n`embedding` VECF32(3) DEFAULT NULL,\nKEY `idx14` USING ivfflat (`embedding`) lists = 2 op_type 'vector_l2_ops' \n) 288 insert into tbl values(15, "[1,3,5]"); -- inserted to centroid 1 of version 0 289 insert into tbl values(18, "[130,40,90]"); -- inserted to centroid 2 of version 0 290 alter table tbl alter reindex idx14 ivfflat lists=2; 291 insert into tbl values(25, "[2,4,5]"); -- inserted to cluster 1 of version 1 292 insert into tbl values(28, "[131,41,91]"); -- inserted to cluster 2 of version 1 293 drop table if exists tbl; 294 create table tbl(id int primary key, embedding vecf32(3)); 295 insert into tbl values(1, "[1,2,3]"); 296 insert into tbl values(2, "[1,2,4]"); 297 insert into tbl values(3, "[1,2.4,4]"); 298 insert into tbl values(4, "[1,2,5]"); 299 insert into tbl values(5, "[1,3,5]"); 300 insert into tbl values(6, "[100,44,50]"); 301 insert into tbl values(7, "[120,50,70]"); 302 insert into tbl values(8, "[130,40,90]"); 303 create index idx15 using ivfflat on tbl(embedding) lists=2 op_type "vector_l2_ops"; 304 insert into tbl values(9, "[130,40,90]"); 305 delete from tbl where id=9; -- delete 9 306 delete from tbl where embedding="[130,40,90]"; -- delete 8 307 alter table tbl alter reindex idx15 ivfflat lists=2; 308 insert into tbl values(10, "[130,40,90]"); 309 delete from tbl where id=6; -- removes both (0,6) and (1,6) entries 310 delete from tbl where embedding="[1,3,5]"; -- removes both (0,5) and (1,5) entries 311 delete from tbl where id=10; -- removes (1,10) 312 drop table if exists tbl; 313 create table tbl(id int primary key, embedding vecf32(3)); 314 insert into tbl values(1, "[1,2,3]"); 315 insert into tbl values(2, "[1,2,4]"); 316 insert into tbl values(3, "[1,2.4,4]"); 317 insert into tbl values(4, "[1,2,5]"); 318 insert into tbl values(5, "[1,3,5]"); 319 insert into tbl values(6, "[100,44,50]"); 320 insert into tbl values(7, "[120,50,70]"); 321 insert into tbl values(8, "[130,40,90]"); 322 create index idx16 using ivfflat on tbl(embedding) lists=2 op_type "vector_l2_ops"; 323 delete from tbl; 324 drop table if exists tbl; 325 create table tbl(id int primary key, embedding vecf32(3)); 326 insert into tbl values(1, "[1,2,3]"); 327 insert into tbl values(2, "[1,2,4]"); 328 insert into tbl values(3, "[1,2.4,4]"); 329 insert into tbl values(4, "[1,2,5]"); 330 insert into tbl values(5, "[1,3,5]"); 331 insert into tbl values(6, "[100,44,50]"); 332 insert into tbl values(7, "[120,50,70]"); 333 insert into tbl values(8, "[130,40,90]"); 334 create index idx16 using ivfflat on tbl(embedding) lists=2 op_type "vector_l2_ops"; 335 truncate table tbl; 336 drop table if exists tbl; 337 create table tbl(id int primary key, embedding vecf32(3)); 338 insert into tbl values(1, "[1,2,3]"); 339 insert into tbl values(2, "[1,2,4]"); 340 insert into tbl values(3, "[1,2.4,4]"); 341 insert into tbl values(4, "[1,2,5]"); 342 insert into tbl values(5, "[1,3,5]"); 343 insert into tbl values(6, "[100,44,50]"); 344 insert into tbl values(7, "[120,50,70]"); 345 insert into tbl values(8, "[130,40,90]"); 346 create index idx16 using ivfflat on tbl(embedding) lists=2 op_type "vector_l2_ops"; 347 update tbl set embedding="[1,2,3]" where id=8; -- update 8 to cluster 1 from cluster 2 348 update tbl set id=9 where id=8; -- update 8 to 9 349 alter table tbl alter reindex idx16 ivfflat lists=2; 350 update tbl set embedding="[1,2,3]" where id=7; -- update 7 to cluster 1 from cluster 2 for the latest versions 351 update tbl set id=10 where id=7; -- update 7 to 10 352 drop table if exists tbl; 353 create table tbl(id varchar(20), age varchar(20), embedding vecf32(3), primary key(id, age)); 354 insert into tbl values("1", "10", "[1,2,3]"); 355 insert into tbl values("2", "20", "[1,2,4]"); 356 insert into tbl values("3", "30", "[1,2.4,4]"); 357 insert into tbl values("4", "40", "[1,2,5]"); 358 insert into tbl values("5", "50", "[1,3,5]"); 359 insert into tbl values("6", "60", "[100,44,50]"); 360 insert into tbl values("7", "70", "[120,50,70]"); 361 insert into tbl values("8", "80", "[130,40,90]"); 362 create index idx17 using ivfflat on tbl(embedding) lists=2 op_type "vector_l2_ops"; 363 update tbl set embedding="[1,2,3]" where id="8"; 364 update tbl set embedding="[1,2,3]" where id="7" and age = "70"; 365 update tbl set id="70" where id="7"; 366 alter table tbl alter reindex idx17 ivfflat lists=2; 367 update tbl set embedding="[1,2,3]" where id="6"; 368 update tbl set id="60" where id="6"; 369 drop table if exists tbl; 370 create table tbl(id int, embedding vecf32(3)); 371 insert into tbl values(1, "[1,2,3]"); 372 insert into tbl values(2, "[1,2,4]"); 373 insert into tbl values(3, "[1,2.4,4]"); 374 insert into tbl values(4, "[1,2,5]"); 375 insert into tbl values(5, "[1,3,5]"); 376 insert into tbl values(6, "[100,44,50]"); 377 insert into tbl values(7, "[120,50,70]"); 378 insert into tbl values(8, "[130,40,90]"); 379 create index idx17 using ivfflat on tbl(embedding) lists=2 op_type "vector_l2_ops"; 380 update tbl set embedding="[1,2,3]" where id="8"; 381 delete from tbl where id="8"; 382 drop table if exists tbl; 383 create table tbl(id int primary key, embedding vecf32(3), key idx18 using ivfflat (embedding) lists=2 op_type "vector_l2_ops"); 384 insert into tbl values(1, "[1,2,3]"); 385 insert into tbl values(2, "[1,2,4]"); 386 insert into tbl values(3, "[1,2.4,4]"); 387 insert into tbl values(4, "[1,2,5]"); 388 insert into tbl values(5, "[1,3,5]"); 389 insert into tbl values(6, "[100,44,50]"); 390 insert into tbl values(7, "[120,50,70]"); 391 insert into tbl values(8, "[130,40,90]"); 392 alter table tbl add column id2 VARCHAR(20); 393 update tbl set id2 = id; 394 drop table if exists tbl1; 395 create table tbl1(id int primary key, data vecf32(3)); 396 insert into tbl1 values(1, "[1,2,3]"); 397 insert into tbl1 values(2, "[1,2,4]"); 398 insert into tbl1 values(3, "[1,2.4,4]"); 399 insert into tbl1 values(4, "[1,2,5]"); 400 insert into tbl1 values(5, "[1,3,5]"); 401 insert into tbl1 values(6, "[100,44,50]"); 402 insert into tbl1 values(7, "[120,50,70]"); 403 insert into tbl1 values(8, "[130,40,90]"); 404 create index idx19 using ivfflat on tbl1(data) lists=2 op_type "vector_l2_ops"; 405 insert into tbl1 values(9, "[130,40,90]"); 406 drop table if exists tbl2; 407 create table tbl2(id int primary key, data vecf32(3), key idx20 using ivfflat (data) lists=2 op_type "vector_l2_ops"); 408 insert into tbl2 select * from tbl1; 409 drop table if exists tbl1; 410 create table tbl1(id int primary key, data vecf32(3)); 411 create index idx19 using ivfflat on tbl1(data) lists=2 op_type "vector_l2_ops"; 412 insert into tbl1 values(1, "[1,2,3]"); 413 insert into tbl1 values(2, "[1,2,4]"); 414 insert into tbl1 values(3, "[1,2.4,4]"); 415 insert into tbl1 values(4, "[1,2,5]"); 416 insert into tbl1 values(5, "[1,3,5]"); 417 insert into tbl1 values(6, "[100,44,50]"); 418 insert into tbl1 values(7, "[120,50,70]"); 419 insert into tbl1 values(8, "[130,40,90]"); 420 drop table if exists tbl; 421 create table tbl(id int primary key, data vecf32(3)); 422 insert into tbl values(1, NULL); 423 insert into tbl values(2, NULL); 424 insert into tbl values(3, NULL); 425 insert into tbl values(4, "[1,2,5]"); 426 insert into tbl values(5, "[1,3,5]"); 427 create index idx20 using ivfflat on tbl(data) lists=2 op_type "vector_l2_ops"; 428 insert into tbl values(6, NULL); 429 insert into tbl values(7, "[130,40,90]"); 430 drop table if exists tbl; 431 create table tbl(id int primary key, data vecf32(3)); 432 insert into tbl values(1, "[1,2,3]"); 433 insert into tbl values(2, "[1,2,4]"); 434 create index idx21 using ivfflat on tbl(data) lists=3 op_type "vector_l2_ops"; 435 drop table if exists tbl; 436 create table tbl(id int primary key, data vecf32(3)); 437 create index idx22 using ivfflat on tbl(data) lists=3 op_type "vector_l2_ops"; 438 insert into tbl values(1, "[1,2,3]"); 439 insert into tbl values(2, "[1,2,4]"); 440 drop table if exists tbl; 441 create table tbl(id int, embedding vecf32(3)); 442 insert into tbl values(1, "[1,2,3]"); 443 insert into tbl values(2, "[1,2,4]"); 444 insert into tbl values(3, "[1,2.4,4]"); 445 insert into tbl values(4, "[1,2,5]"); 446 insert into tbl values(5, "[1,3,5]"); 447 insert into tbl values(6, "[100,44,50]"); 448 insert into tbl values(7, "[120,50,70]"); 449 insert into tbl values(8, "[130,40,90]"); 450 create index idx23 using ivfflat on tbl(embedding) lists=2 op_type "vector_l2_ops"; 451 alter table tbl alter reindex idx23 ivfflat lists=2; 452 truncate table tbl; 453 insert into tbl values(1, "[1,2,3]"); 454 insert into tbl values(2, "[1,2,4]"); 455 insert into tbl values(3, "[1,2.4,4]"); 456 insert into tbl values(4, "[1,2,5]"); 457 insert into tbl values(5, "[1,3,5]"); 458 insert into tbl values(6, "[100,44,50]"); 459 insert into tbl values(7, "[120,50,70]"); 460 insert into tbl values(8, "[130,40,90]"); 461 drop table if exists tbl; 462 create table tbl(id int, embedding vecf32(3)); 463 insert into tbl values(1, "[1,2,3]"); 464 insert into tbl values(2, "[1,2,4]"); 465 insert into tbl values(3, "[1,2.4,4]"); 466 insert into tbl values(4, "[1,2,5]"); 467 insert into tbl values(5, "[1,3,5]"); 468 insert into tbl values(6, "[100,44,50]"); 469 insert into tbl values(7, "[120,50,70]"); 470 insert into tbl values(8, "[130,40,90]"); 471 create index idx23 using ivfflat on tbl(embedding) lists=2 op_type "vector_l2_ops"; 472 alter table tbl alter reindex idx23 ivfflat lists=2; 473 delete from tbl; 474 insert into tbl values(1, "[1,2,3]"); 475 insert into tbl values(2, "[1,2,4]"); 476 insert into tbl values(3, "[1,2.4,4]"); 477 insert into tbl values(4, "[1,2,5]"); 478 insert into tbl values(5, "[1,3,5]"); 479 insert into tbl values(6, "[100,44,50]"); 480 insert into tbl values(7, "[120,50,70]"); 481 insert into tbl values(8, "[130,40,90]"); 482 drop table if exists tbl; 483 create table tbl(id int primary key, embedding vecf32(3)); 484 insert into tbl values(1, "[1,2,3]"); 485 insert into tbl values(2, "[1,2,4]"); 486 insert into tbl values(3, "[1,2.4,4]"); 487 insert into tbl values(4, "[1,2,5]"); 488 insert into tbl values(5, "[1,3,5]"); 489 insert into tbl values(6, "[100,44,50]"); 490 insert into tbl values(7, "[120,50,70]"); 491 insert into tbl values(8, "[130,40,90]"); 492 create index idx16 using ivfflat on tbl(embedding) lists=2 op_type "vector_l2_ops"; 493 create index idx17 using ivfflat on tbl(embedding) lists=2 op_type "vector_l2_ops"; 494 insert into tbl values(9, "[130,40,90]"); 495 drop table if exists tbl; 496 SET @PROBE_LIMIT=1; 497 create table tbl(id int PRIMARY KEY, embedding vecf32(3)); 498 insert into tbl values(1, "[1,2,3]"); 499 insert into tbl values(2, "[1,2,4]"); 500 insert into tbl values(3, "[1,2.4,4]"); 501 insert into tbl values(4, "[1,2,5]"); 502 insert into tbl values(5, "[1,3,5]"); 503 insert into tbl values(6, "[100,44,50]"); 504 insert into tbl values(7, "[120,50,70]"); 505 insert into tbl values(8, "[130,40,90]"); 506 SELECT id, embedding FROM tbl ORDER BY l2_distance(embedding,'[120,51,70]') ASC LIMIT 3; 507 id embedding 508 7 [120, 50, 70] 509 8 [130, 40, 90] 510 6 [100, 44, 50] 511 create index idx using ivfflat on tbl(embedding) lists=2 op_type "vector_l2_ops"; 512 SELECT id, embedding FROM tbl ORDER BY l2_distance(embedding,'[120,51,70]') ASC LIMIT 3; 513 id embedding 514 7 [120, 50, 70] 515 8 [130, 40, 90] 516 6 [100, 44, 50] 517 drop table if exists tbl; 518 create table tbl(id int, embedding vecf32(3)); 519 insert into tbl values(1, "[1,2,3]"); 520 insert into tbl values(2, "[1,2,4]"); 521 insert into tbl values(3, "[1,2.4,4]"); 522 insert into tbl values(4, "[1,2,5]"); 523 insert into tbl values(5, "[1,3,5]"); 524 insert into tbl values(6, "[100,44,50]"); 525 insert into tbl values(7, "[120,50,70]"); 526 insert into tbl values(8, "[130,40,90]"); 527 SELECT id, embedding FROM tbl ORDER BY l2_distance(embedding,'[120,51,70]') ASC LIMIT 3; 528 id embedding 529 7 [120, 50, 70] 530 8 [130, 40, 90] 531 6 [100, 44, 50] 532 create index idx using ivfflat on tbl(embedding) lists=2 op_type "vector_l2_ops"; 533 SELECT id, embedding FROM tbl ORDER BY l2_distance(embedding,'[120,51,70]') ASC LIMIT 3; 534 id embedding 535 7 [120, 50, 70] 536 8 [130, 40, 90] 537 6 [100, 44, 50] 538 drop table if exists tbl; 539 create table tbl(id int, id2 int, embedding vecf32(3), primary key(id, id2)); 540 insert into tbl values(1, 0,"[1,2,3]"); 541 insert into tbl values(2, 0, "[1,2,4]"); 542 insert into tbl values(3, 0,"[1,2.4,4]"); 543 insert into tbl values(4, 0, "[1,2,5]"); 544 insert into tbl values(5, 0, "[1,3,5]"); 545 insert into tbl values(6, 0, "[100,44,50]"); 546 insert into tbl values(7, 0, "[120,50,70]"); 547 insert into tbl values(8, 0, "[130,40,90]"); 548 SELECT id,id2, embedding FROM tbl ORDER BY l2_distance(embedding,'[120,51,70]') ASC LIMIT 3; 549 id id2 embedding 550 7 0 [120, 50, 70] 551 8 0 [130, 40, 90] 552 6 0 [100, 44, 50] 553 create index idx using ivfflat on tbl(embedding) lists=2 op_type "vector_l2_ops"; 554 SELECT id,id2, embedding FROM tbl ORDER BY l2_distance(embedding,'[120,51,70]') ASC LIMIT 3; 555 id id2 embedding 556 7 0 [120, 50, 70] 557 8 0 [130, 40, 90] 558 6 0 [100, 44, 50] 559 SET @test_limit = 3; 560 SELECT id from tbl LIMIT @test_limit; 561 id 562 1 563 2 564 3 565 create table vector_index_05(a int primary key, b vecf32(3),c vecf32(4)); 566 create index idx01 using ivfflat on vector_index_05(c) lists=4 op_type "vector_l2_ops"; 567 show create table vector_index_05; 568 Table Create Table 569 vector_index_05 CREATE TABLE `vector_index_05` (\n`a` INT NOT NULL,\n`b` VECF32(3) DEFAULT NULL,\n`c` VECF32(4) DEFAULT NULL,\nPRIMARY KEY (`a`),\nKEY `idx01` USING ivfflat (`c`) lists = 4 op_type 'vector_l2_ops' \n) 570 alter table vector_index_05 alter reindex idx01 ivfflat lists=5; 571 show create table vector_index_05; 572 Table Create Table 573 vector_index_05 CREATE TABLE `vector_index_05` (\n`a` INT NOT NULL,\n`b` VECF32(3) DEFAULT NULL,\n`c` VECF32(4) DEFAULT NULL,\nPRIMARY KEY (`a`),\nKEY `idx01` USING ivfflat (`c`) lists = 5 op_type 'vector_l2_ops' \n) 574 create table vector_index_04(a int primary key, b vecf32(3),c vecf32(4)); 575 insert into vector_index_04 values(1,"[56,23,6]","[0.25,0.14,0.88,0.0001]"),(2,"[77,45,3]","[1.25,5.25,8.699,4.25]"),(3,"[8,56,3]","[9.66,5.22,1.22,7.02]"); 576 create index idx01 using ivfflat on vector_index_04(c) lists=5 op_type "vector_l2_ops"; 577 insert into vector_index_04 values(4,"[156,213,61]","[10.25,0.14,0.88,10.0001]"),(5,"[177,425,30]","[11.25,51.25,80.699,44.25]"),(6,"[80,56,3]","[90.686,5.212,19.22,7.02]"); 578 show create table vector_index_04; 579 Table Create Table 580 vector_index_04 CREATE TABLE `vector_index_04` (\n`a` INT NOT NULL,\n`b` VECF32(3) DEFAULT NULL,\n`c` VECF32(4) DEFAULT NULL,\nPRIMARY KEY (`a`),\nKEY `idx01` USING ivfflat (`c`) lists = 5 op_type 'vector_l2_ops' \n) 581 alter table vector_index_04 alter reindex idx01 ivfflat lists=8; 582 show create table vector_index_04; 583 Table Create Table 584 vector_index_04 CREATE TABLE `vector_index_04` (\n`a` INT NOT NULL,\n`b` VECF32(3) DEFAULT NULL,\n`c` VECF32(4) DEFAULT NULL,\nPRIMARY KEY (`a`),\nKEY `idx01` USING ivfflat (`c`) lists = 8 op_type 'vector_l2_ops' \n) 585 create table vector_index_08(a int primary key, b vecf32(128),c int,key c_k(c)); 586 create index idx01 using ivfflat on vector_index_08(b) lists=3 op_type "vector_l2_ops"; 587 alter table vector_index_08 add column d vecf32(3) not null after c; 588 create table vector_index_07(a int primary key, b vecf32(128),c int,key c_k(c)); 589 create index idx01 using ivfflat on vector_index_07(b); 590 create index idx02 using ivfflat on vector_index_07(b) lists=0; 591 SQL parser error: You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. LISTS should be greater than 0 at line 1 column 62 near "0;"; 592 alter table vector_index_07 reindex idx01 ivfflat lists=0; 593 SQL parser error: You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. syntax error at line 1 column 35 near " reindex idx01 ivfflat lists=0;"; 594 alter table vector_index_07 reindex idx01 ivfflat; 595 SQL parser error: You have an error in your SQL syntax; check the manual that corresponds to your MatrixOne server version for the right syntax to use. syntax error at line 1 column 35 near " reindex idx01 ivfflat;"; 596 create table vector_index_09(a int primary key, b vecf32(128),c int,key c_k(c)); 597 insert into vector_index_09 values(9774 ,NULL,3),(9775,NULL,10); 598 insert into vector_index_09(a,c) values(9777,4),(9778,9); 599 create index idx01 using ivfflat on vector_index_09(b) lists=3 op_type "vector_l2_ops"; 600 select * from vector_index_09 order by L2_DISTANCE(b,"[1, 0, 1, 6, 6, 17, 47]"); 601 a b c 602 9774 null 3 603 9775 null 10 604 9777 null 4 605 9778 null 9 606 insert into vector_index_09 values(97741 ,"[1, 0, 1, 6, 6, 17, 47, 39, 2, 0, 1, 25, 27, 10, 56, 130, 18, 5, 2, 6, 15, 2, 19, 130, 42, 28, 1, 1, 2, 1, 0, 5, 0, 2, 4, 4, 31, 34, 44, 35, 9, 3, 8, 11, 33, 12, 61, 130, 130, 17, 0, 1, 6, 2, 9, 130, 111, 36, 0, 0, 11, 9, 1, 12, 2, 100, 130, 28, 7, 2, 6, 7, 9, 27, 130, 83, 5, 0, 1, 18, 130, 130, 84, 9, 0, 0, 2, 24, 111, 24, 0, 1, 37, 24, 2, 10, 12, 62, 33, 3, 0, 0, 0, 1, 3, 16, 106, 28, 0, 0, 0, 0, 17, 46, 85, 10, 0, 0, 1, 4, 11, 4, 2, 2, 9, 14, 8, 8]",3),(97751,"[0, 1, 1, 3, 0, 3, 46, 20, 1, 4, 17, 9, 1, 17, 108, 15, 0, 3, 37, 17, 6, 15, 116, 16, 6, 1, 4, 7, 7, 7, 9, 6, 0, 8, 10, 4, 26, 129, 27, 9, 0, 0, 5, 2, 11, 129, 129, 12, 103, 4, 0, 0, 2, 31, 129, 129, 94, 4, 0, 0, 0, 3, 13, 42, 0, 15, 38, 2, 70, 129, 1, 0, 5, 10, 40, 12, 74, 129, 6, 1, 129, 39, 6, 1, 2, 22, 9, 33, 122, 13, 0, 0, 0, 0, 5, 23, 4, 11, 9, 12, 45, 38, 1, 0, 0, 4, 36, 38, 57, 32, 0, 0, 82, 22, 9, 5, 13, 11, 3, 94, 35, 3, 0, 0, 0, 1, 16, 97]",5),(9776,"[10, 3, 8, 5, 48, 26, 5, 16, 17, 0, 0, 2, 132, 53, 1, 16, 112, 6, 0, 0, 7, 2, 1, 48, 48, 15, 18, 31, 3, 0, 0, 9, 6, 10, 19, 27, 50, 46, 17, 9, 18, 1, 4, 48, 132, 23, 3, 5, 132, 9, 4, 3, 11, 0, 2, 46, 84, 12, 10, 10, 1, 0, 12, 76, 26, 22, 16, 26, 35, 15, 3, 16, 15, 1, 51, 132, 125, 8, 1, 2, 132, 51, 67, 91, 8, 0, 0, 30, 126, 39, 32, 38, 4, 0, 1, 12, 24, 2, 2, 2, 4, 7, 2, 19, 93, 19, 70, 92, 2, 3, 1, 21, 36, 58, 132, 94, 0, 0, 0, 0, 21, 25, 57, 48, 1, 0, 0, 1]",3); 607 insert into vector_index_09 values(97771, "[16, 15, 0, 0, 5, 46, 5, 5, 4, 0, 0, 0, 28, 118, 12, 5, 75, 44, 5, 0, 6, 32, 6, 49, 41, 74, 9, 1, 0, 0, 0, 9, 1, 9, 16, 41, 71, 80, 3, 0, 0, 4, 3, 5, 51, 106, 11, 3, 112, 28, 13, 1, 4, 8, 3, 104, 118, 14, 1, 1, 0, 0, 0, 88, 3, 27, 46, 118, 108, 49, 2, 0, 1, 46, 118, 118, 27, 12, 0, 0, 33, 118, 118, 8, 0, 0, 0, 4, 118, 95, 40, 0, 0, 0, 1, 11, 27, 38, 12, 12, 18, 29, 3, 2, 13, 30, 94, 78, 30, 19, 9, 3, 31, 45, 70, 42, 15, 1, 3, 12, 14, 22, 16, 2, 3, 17, 24, 13]",4),(97781,"[41, 0, 0, 7, 1, 1, 20, 67, 9, 0, 0, 0, 0, 31, 120, 61, 25, 0, 0, 0, 0, 10, 120, 90, 32, 0, 0, 1, 13, 11, 22, 50, 4, 0, 2, 93, 40, 15, 37, 18, 12, 2, 2, 19, 8, 44, 120, 25, 120, 5, 0, 0, 0, 2, 48, 97, 102, 14, 3, 3, 11, 9, 34, 41, 0, 0, 4, 120, 56, 3, 4, 5, 6, 15, 37, 116, 28, 0, 0, 3, 120, 120, 24, 6, 2, 0, 1, 28, 53, 90, 51, 11, 11, 2, 12, 14, 8, 6, 4, 30, 9, 1, 4, 22, 25, 79, 120, 66, 5, 0, 0, 6, 42, 120, 91, 43, 15, 2, 4, 39, 12, 9, 9, 12, 15, 5, 24, 36]",4); 608 alter table vector_index_09 alter reindex idx01 ivfflat lists=2; 609 drop table if exists vector_index_07; 610 create table vector_index_07(a int primary key, b vecf32(128),c int,key c_k(c)); 611 create index idx01 using ivfflat on vector_index_07(b) lists=5 op_type "vector_l2_ops"; 612 insert into vector_index_07 values(9774 ,"[1, 0, 1, 6, 6, 17, 47, 39, 2, 0, 1, 25, 27, 10, 56, 130, 18, 5, 2, 6, 15, 2, 19, 130, 42, 28, 1, 1, 2, 1, 0, 5, 0, 2, 4, 4, 31, 34, 44, 35, 9, 3, 8, 11, 33, 12, 61, 130, 130, 17, 0, 1, 6, 2, 9, 130, 111, 36, 0, 0, 11, 9, 1, 12, 2, 100, 130, 28, 7, 2, 6, 7, 9, 27, 130, 83, 5, 0, 1, 18, 130, 130, 84, 9, 0, 0, 2, 24, 111, 24, 0, 1, 37, 24, 2, 10, 12, 62, 33, 3, 0, 0, 0, 1, 3, 16, 106, 28, 0, 0, 0, 0, 17, 46, 85, 10, 0, 0, 1, 4, 11, 4, 2, 2, 9, 14, 8, 8]",3),(9775,"[0, 1, 1, 3, 0, 3, 46, 20, 1, 4, 17, 9, 1, 17, 108, 15, 0, 3, 37, 17, 6, 15, 116, 16, 6, 1, 4, 7, 7, 7, 9, 6, 0, 8, 10, 4, 26, 129, 27, 9, 0, 0, 5, 2, 11, 129, 129, 12, 103, 4, 0, 0, 2, 31, 129, 129, 94, 4, 0, 0, 0, 3, 13, 42, 0, 15, 38, 2, 70, 129, 1, 0, 5, 10, 40, 12, 74, 129, 6, 1, 129, 39, 6, 1, 2, 22, 9, 33, 122, 13, 0, 0, 0, 0, 5, 23, 4, 11, 9, 12, 45, 38, 1, 0, 0, 4, 36, 38, 57, 32, 0, 0, 82, 22, 9, 5, 13, 11, 3, 94, 35, 3, 0, 0, 0, 1, 16, 97]",5),(9776,"[10, 3, 8, 5, 48, 26, 5, 16, 17, 0, 0, 2, 132, 53, 1, 16, 112, 6, 0, 0, 7, 2, 1, 48, 48, 15, 18, 31, 3, 0, 0, 9, 6, 10, 19, 27, 50, 46, 17, 9, 18, 1, 4, 48, 132, 23, 3, 5, 132, 9, 4, 3, 11, 0, 2, 46, 84, 12, 10, 10, 1, 0, 12, 76, 26, 22, 16, 26, 35, 15, 3, 16, 15, 1, 51, 132, 125, 8, 1, 2, 132, 51, 67, 91, 8, 0, 0, 30, 126, 39, 32, 38, 4, 0, 1, 12, 24, 2, 2, 2, 4, 7, 2, 19, 93, 19, 70, 92, 2, 3, 1, 21, 36, 58, 132, 94, 0, 0, 0, 0, 21, 25, 57, 48, 1, 0, 0, 1]",3); 613 insert into vector_index_07 values(9777, " [16, 15, 0, 0, 5, 46, 5, 5, 4, 0, 0, 0, 28, 118, 12, 5, 75, 44, 5, 0, 6, 32, 6, 49, 41, 74, 9, 1, 0, 0, 0, 9, 1, 9, 16, 41, 71, 80, 3, 0, 0, 4, 3, 5, 51, 106, 11, 3, 112, 28, 13, 1, 4, 8, 3, 104, 118, 14, 1, 1, 0, 0, 0, 88, 3, 27, 46, 118, 108, 49, 2, 0, 1, 46, 118, 118, 27, 12, 0, 0, 33, 118, 118, 8, 0, 0, 0, 4, 118, 95, 40, 0, 0, 0, 1, 11, 27, 38, 12, 12, 18, 29, 3, 2, 13, 30, 94, 78, 30, 19, 9, 3, 31, 45, 70, 42, 15, 1, 3, 12, 14, 22, 16, 2, 3, 17, 24, 13]",4),(9778,"[41, 0, 0, 7, 1, 1, 20, 67, 9, 0, 0, 0, 0, 31, 120, 61, 25, 0, 0, 0, 0, 10, 120, 90, 32, 0, 0, 1, 13, 11, 22, 50, 4, 0, 2, 93, 40, 15, 37, 18, 12, 2, 2, 19, 8, 44, 120, 25, 120, 5, 0, 0, 0, 2, 48, 97, 102, 14, 3, 3, 11, 9, 34, 41, 0, 0, 4, 120, 56, 3, 4, 5, 6, 15, 37, 116, 28, 0, 0, 3, 120, 120, 24, 6, 2, 0, 1, 28, 53, 90, 51, 11, 11, 2, 12, 14, 8, 6, 4, 30, 9, 1, 4, 22, 25, 79, 120, 66, 5, 0, 0, 6, 42, 120, 91, 43, 15, 2, 4, 39, 12, 9, 9, 12, 15, 5, 24, 36]",4); 614 select * from vector_index_07 order by L2_DISTANCE(b, "abc") ASC LIMIT 2; 615 internal error: malformed vector input: abc 616 drop table if exists vector_index_08; 617 create table vector_index_08(a int auto_increment primary key, b vecf32(128),c int,key c_k(c)); 618 insert into vector_index_08 values(9774 ,"[1, 0, 1, 6, 6, 17, 47, 39, 2, 0, 1, 25, 27, 10, 56, 130, 18, 5, 2, 6, 15, 2, 19, 130, 42, 28, 1, 1, 2, 1, 0, 5, 0, 2, 4, 4, 31, 34, 44, 35, 9, 3, 8, 11, 33, 12, 61, 130, 130, 17, 0, 1, 6, 2, 9, 130, 111, 36, 0, 0, 11, 9, 1, 12, 2, 100, 130, 28, 7, 2, 6, 7, 9, 27, 130, 83, 5, 0, 1, 18, 130, 130, 84, 9, 0, 0, 2, 24, 111, 24, 0, 1, 37, 24, 2, 10, 12, 62, 33, 3, 0, 0, 0, 1, 3, 16, 106, 28, 0, 0, 0, 0, 17, 46, 85, 10, 0, 0, 1, 4, 11, 4, 2, 2, 9, 14, 8, 8]",3),(9775,"[0, 1, 1, 3, 0, 3, 46, 20, 1, 4, 17, 9, 1, 17, 108, 15, 0, 3, 37, 17, 6, 15, 116, 16, 6, 1, 4, 7, 7, 7, 9, 6, 0, 8, 10, 4, 26, 129, 27, 9, 0, 0, 5, 2, 11, 129, 129, 12, 103, 4, 0, 0, 2, 31, 129, 129, 94, 4, 0, 0, 0, 3, 13, 42, 0, 15, 38, 2, 70, 129, 1, 0, 5, 10, 40, 12, 74, 129, 6, 1, 129, 39, 6, 1, 2, 22, 9, 33, 122, 13, 0, 0, 0, 0, 5, 23, 4, 11, 9, 12, 45, 38, 1, 0, 0, 4, 36, 38, 57, 32, 0, 0, 82, 22, 9, 5, 13, 11, 3, 94, 35, 3, 0, 0, 0, 1, 16, 97]",5),(9776,"[10, 3, 8, 5, 48, 26, 5, 16, 17, 0, 0, 2, 132, 53, 1, 16, 112, 6, 0, 0, 7, 2, 1, 48, 48, 15, 18, 31, 3, 0, 0, 9, 6, 10, 19, 27, 50, 46, 17, 9, 18, 1, 4, 48, 132, 23, 3, 5, 132, 9, 4, 3, 11, 0, 2, 46, 84, 12, 10, 10, 1, 0, 12, 76, 26, 22, 16, 26, 35, 15, 3, 16, 15, 1, 51, 132, 125, 8, 1, 2, 132, 51, 67, 91, 8, 0, 0, 30, 126, 39, 32, 38, 4, 0, 1, 12, 24, 2, 2, 2, 4, 7, 2, 19, 93, 19, 70, 92, 2, 3, 1, 21, 36, 58, 132, 94, 0, 0, 0, 0, 21, 25, 57, 48, 1, 0, 0, 1]",3); 619 insert into vector_index_08 values(9777, "[16, 15, 0, 0, 5, 46, 5, 5, 4, 0, 0, 0, 28, 118, 12, 5, 75, 44, 5, 0, 6, 32, 6, 49, 41, 74, 9, 1, 0, 0, 0, 9, 1, 9, 16, 41, 71, 80, 3, 0, 0, 4, 3, 5, 51, 106, 11, 3, 112, 28, 13, 1, 4, 8, 3, 104, 118, 14, 1, 1, 0, 0, 0, 88, 3, 27, 46, 118, 108, 49, 2, 0, 1, 46, 118, 118, 27, 12, 0, 0, 33, 118, 118, 8, 0, 0, 0, 4, 118, 95, 40, 0, 0, 0, 1, 11, 27, 38, 12, 12, 18, 29, 3, 2, 13, 30, 94, 78, 30, 19, 9, 3, 31, 45, 70, 42, 15, 1, 3, 12, 14, 22, 16, 2, 3, 17, 24, 13]",4),(9778,"[41, 0, 0, 7, 1, 1, 20, 67, 9, 0, 0, 0, 0, 31, 120, 61, 25, 0, 0, 0, 0, 10, 120, 90, 32, 0, 0, 1, 13, 11, 22, 50, 4, 0, 2, 93, 40, 15, 37, 18, 12, 2, 2, 19, 8, 44, 120, 25, 120, 5, 0, 0, 0, 2, 48, 97, 102, 14, 3, 3, 11, 9, 34, 41, 0, 0, 4, 120, 56, 3, 4, 5, 6, 15, 37, 116, 28, 0, 0, 3, 120, 120, 24, 6, 2, 0, 1, 28, 53, 90, 51, 11, 11, 2, 12, 14, 8, 6, 4, 30, 9, 1, 4, 22, 25, 79, 120, 66, 5, 0, 0, 6, 42, 120, 91, 43, 15, 2, 4, 39, 12, 9, 9, 12, 15, 5, 24, 36]",4); 620 create index idx01 using ivfflat on vector_index_08(b) lists=3 op_type "vector_l2_ops"; 621 select * from vector_index_08 ; 622 a b c 623 9774 [1, 0, 1, 6, 6, 17, 47, 39, 2, 0, 1, 25, 27, 10, 56, 130, 18, 5, 2, 6, 15, 2, 19, 130, 42, 28, 1, 1, 2, 1, 0, 5, 0, 2, 4, 4, 31, 34, 44, 35, 9, 3, 8, 11, 33, 12, 61, 130, 130, 17, 0, 1, 6, 2, 9, 130, 111, 36, 0, 0, 11, 9, 1, 12, 2, 100, 130, 28, 7, 2, 6, 7, 9, 27, 130, 83, 5, 0, 1, 18, 130, 130, 84, 9, 0, 0, 2, 24, 111, 24, 0, 1, 37, 24, 2, 10, 12, 62, 33, 3, 0, 0, 0, 1, 3, 16, 106, 28, 0, 0, 0, 0, 17, 46, 85, 10, 0, 0, 1, 4, 11, 4, 2, 2, 9, 14, 8, 8] 3 624 9775 [0, 1, 1, 3, 0, 3, 46, 20, 1, 4, 17, 9, 1, 17, 108, 15, 0, 3, 37, 17, 6, 15, 116, 16, 6, 1, 4, 7, 7, 7, 9, 6, 0, 8, 10, 4, 26, 129, 27, 9, 0, 0, 5, 2, 11, 129, 129, 12, 103, 4, 0, 0, 2, 31, 129, 129, 94, 4, 0, 0, 0, 3, 13, 42, 0, 15, 38, 2, 70, 129, 1, 0, 5, 10, 40, 12, 74, 129, 6, 1, 129, 39, 6, 1, 2, 22, 9, 33, 122, 13, 0, 0, 0, 0, 5, 23, 4, 11, 9, 12, 45, 38, 1, 0, 0, 4, 36, 38, 57, 32, 0, 0, 82, 22, 9, 5, 13, 11, 3, 94, 35, 3, 0, 0, 0, 1, 16, 97] 5 625 9776 [10, 3, 8, 5, 48, 26, 5, 16, 17, 0, 0, 2, 132, 53, 1, 16, 112, 6, 0, 0, 7, 2, 1, 48, 48, 15, 18, 31, 3, 0, 0, 9, 6, 10, 19, 27, 50, 46, 17, 9, 18, 1, 4, 48, 132, 23, 3, 5, 132, 9, 4, 3, 11, 0, 2, 46, 84, 12, 10, 10, 1, 0, 12, 76, 26, 22, 16, 26, 35, 15, 3, 16, 15, 1, 51, 132, 125, 8, 1, 2, 132, 51, 67, 91, 8, 0, 0, 30, 126, 39, 32, 38, 4, 0, 1, 12, 24, 2, 2, 2, 4, 7, 2, 19, 93, 19, 70, 92, 2, 3, 1, 21, 36, 58, 132, 94, 0, 0, 0, 0, 21, 25, 57, 48, 1, 0, 0, 1] 3 626 9777 [16, 15, 0, 0, 5, 46, 5, 5, 4, 0, 0, 0, 28, 118, 12, 5, 75, 44, 5, 0, 6, 32, 6, 49, 41, 74, 9, 1, 0, 0, 0, 9, 1, 9, 16, 41, 71, 80, 3, 0, 0, 4, 3, 5, 51, 106, 11, 3, 112, 28, 13, 1, 4, 8, 3, 104, 118, 14, 1, 1, 0, 0, 0, 88, 3, 27, 46, 118, 108, 49, 2, 0, 1, 46, 118, 118, 27, 12, 0, 0, 33, 118, 118, 8, 0, 0, 0, 4, 118, 95, 40, 0, 0, 0, 1, 11, 27, 38, 12, 12, 18, 29, 3, 2, 13, 30, 94, 78, 30, 19, 9, 3, 31, 45, 70, 42, 15, 1, 3, 12, 14, 22, 16, 2, 3, 17, 24, 13] 4 627 9778 [41, 0, 0, 7, 1, 1, 20, 67, 9, 0, 0, 0, 0, 31, 120, 61, 25, 0, 0, 0, 0, 10, 120, 90, 32, 0, 0, 1, 13, 11, 22, 50, 4, 0, 2, 93, 40, 15, 37, 18, 12, 2, 2, 19, 8, 44, 120, 25, 120, 5, 0, 0, 0, 2, 48, 97, 102, 14, 3, 3, 11, 9, 34, 41, 0, 0, 4, 120, 56, 3, 4, 5, 6, 15, 37, 116, 28, 0, 0, 3, 120, 120, 24, 6, 2, 0, 1, 28, 53, 90, 51, 11, 11, 2, 12, 14, 8, 6, 4, 30, 9, 1, 4, 22, 25, 79, 120, 66, 5, 0, 0, 6, 42, 120, 91, 43, 15, 2, 4, 39, 12, 9, 9, 12, 15, 5, 24, 36] 4 628 update vector_index_08 set b="[16, 15, 0, 0, 5, 46, 5, 5, 4, 0, 0, 0, 28, 118, 12, 5, 75, 44, 5, 0, 6, 32, 6, 49, 41, 74, 9, 1, 0, 0, 0, 9, 1, 9, 16, 41, 71, 80, 3, 0, 0, 4, 3, 5, 51, 106, 11, 3, 112, 28, 13, 1, 4, 8, 3, 104, 118, 14, 1, 1, 0, 0, 0, 88, 3, 27, 46, 118, 108, 49, 2, 0, 1, 46, 118, 118, 27, 12, 0, 0, 33, 118, 118, 8, 0, 0, 0, 4, 118, 95, 40, 0, 0, 0, 1, 11, 27, 38, 12, 12, 18, 29, 3, 2, 13, 30, 94, 78, 30, 19, 9, 3, 31, 45, 70, 42, 15, 1, 3, 12, 14, 22, 16, 2, 3, 17, 24, 13]" where a=9774; 629 select * from vector_index_08 where a=9774; 630 a b c 631 9774 [16, 15, 0, 0, 5, 46, 5, 5, 4, 0, 0, 0, 28, 118, 12, 5, 75, 44, 5, 0, 6, 32, 6, 49, 41, 74, 9, 1, 0, 0, 0, 9, 1, 9, 16, 41, 71, 80, 3, 0, 0, 4, 3, 5, 51, 106, 11, 3, 112, 28, 13, 1, 4, 8, 3, 104, 118, 14, 1, 1, 0, 0, 0, 88, 3, 27, 46, 118, 108, 49, 2, 0, 1, 46, 118, 118, 27, 12, 0, 0, 33, 118, 118, 8, 0, 0, 0, 4, 118, 95, 40, 0, 0, 0, 1, 11, 27, 38, 12, 12, 18, 29, 3, 2, 13, 30, 94, 78, 30, 19, 9, 3, 31, 45, 70, 42, 15, 1, 3, 12, 14, 22, 16, 2, 3, 17, 24, 13] 3 632 delete from vector_index_08 where a=9777; 633 select * from vector_index_08 where a=9777; 634 a b c 635 truncate table vector_index_08; 636 select * from vector_index_08; 637 a b c 638 insert into vector_index_08 values(9774 ,"[1, 0, 1, 6, 6, 17, 47, 39, 2, 0, 1, 25, 27, 10, 56, 130, 18, 5, 2, 6, 15, 2, 19, 130, 42, 28, 1, 1, 2, 1, 0, 5, 0, 2, 4, 4, 31, 34, 44, 35, 9, 3, 8, 11, 33, 12, 61, 130, 130, 17, 0, 1, 6, 2, 9, 130, 111, 36, 0, 0, 11, 9, 1, 12, 2, 100, 130, 28, 7, 2, 6, 7, 9, 27, 130, 83, 5, 0, 1, 18, 130, 130, 84, 9, 0, 0, 2, 24, 111, 24, 0, 1, 37, 24, 2, 10, 12, 62, 33, 3, 0, 0, 0, 1, 3, 16, 106, 28, 0, 0, 0, 0, 17, 46, 85, 10, 0, 0, 1, 4, 11, 4, 2, 2, 9, 14, 8, 8]",3),(9775,"[0, 1, 1, 3, 0, 3, 46, 20, 1, 4, 17, 9, 1, 17, 108, 15, 0, 3, 37, 17, 6, 15, 116, 16, 6, 1, 4, 7, 7, 7, 9, 6, 0, 8, 10, 4, 26, 129, 27, 9, 0, 0, 5, 2, 11, 129, 129, 12, 103, 4, 0, 0, 2, 31, 129, 129, 94, 4, 0, 0, 0, 3, 13, 42, 0, 15, 38, 2, 70, 129, 1, 0, 5, 10, 40, 12, 74, 129, 6, 1, 129, 39, 6, 1, 2, 22, 9, 33, 122, 13, 0, 0, 0, 0, 5, 23, 4, 11, 9, 12, 45, 38, 1, 0, 0, 4, 36, 38, 57, 32, 0, 0, 82, 22, 9, 5, 13, 11, 3, 94, 35, 3, 0, 0, 0, 1, 16, 97]",5),(9776,"[10, 3, 8, 5, 48, 26, 5, 16, 17, 0, 0, 2, 132, 53, 1, 16, 112, 6, 0, 0, 7, 2, 1, 48, 48, 15, 18, 31, 3, 0, 0, 9, 6, 10, 19, 27, 50, 46, 17, 9, 18, 1, 4, 48, 132, 23, 3, 5, 132, 9, 4, 3, 11, 0, 2, 46, 84, 12, 10, 10, 1, 0, 12, 76, 26, 22, 16, 26, 35, 15, 3, 16, 15, 1, 51, 132, 125, 8, 1, 2, 132, 51, 67, 91, 8, 0, 0, 30, 126, 39, 32, 38, 4, 0, 1, 12, 24, 2, 2, 2, 4, 7, 2, 19, 93, 19, 70, 92, 2, 3, 1, 21, 36, 58, 132, 94, 0, 0, 0, 0, 21, 25, 57, 48, 1, 0, 0, 1]",3); 639 alter table vector_index_08 add column d vecf32(3) not null after c; 640 select * from vector_index_08; 641 a b c d 642 9774 [1, 0, 1, 6, 6, 17, 47, 39, 2, 0, 1, 25, 27, 10, 56, 130, 18, 5, 2, 6, 15, 2, 19, 130, 42, 28, 1, 1, 2, 1, 0, 5, 0, 2, 4, 4, 31, 34, 44, 35, 9, 3, 8, 11, 33, 12, 61, 130, 130, 17, 0, 1, 6, 2, 9, 130, 111, 36, 0, 0, 11, 9, 1, 12, 2, 100, 130, 28, 7, 2, 6, 7, 9, 27, 130, 83, 5, 0, 1, 18, 130, 130, 84, 9, 0, 0, 2, 24, 111, 24, 0, 1, 37, 24, 2, 10, 12, 62, 33, 3, 0, 0, 0, 1, 3, 16, 106, 28, 0, 0, 0, 0, 17, 46, 85, 10, 0, 0, 1, 4, 11, 4, 2, 2, 9, 14, 8, 8] 3 [0, 0, 0] 643 9775 [0, 1, 1, 3, 0, 3, 46, 20, 1, 4, 17, 9, 1, 17, 108, 15, 0, 3, 37, 17, 6, 15, 116, 16, 6, 1, 4, 7, 7, 7, 9, 6, 0, 8, 10, 4, 26, 129, 27, 9, 0, 0, 5, 2, 11, 129, 129, 12, 103, 4, 0, 0, 2, 31, 129, 129, 94, 4, 0, 0, 0, 3, 13, 42, 0, 15, 38, 2, 70, 129, 1, 0, 5, 10, 40, 12, 74, 129, 6, 1, 129, 39, 6, 1, 2, 22, 9, 33, 122, 13, 0, 0, 0, 0, 5, 23, 4, 11, 9, 12, 45, 38, 1, 0, 0, 4, 36, 38, 57, 32, 0, 0, 82, 22, 9, 5, 13, 11, 3, 94, 35, 3, 0, 0, 0, 1, 16, 97] 5 [0, 0, 0] 644 9776 [10, 3, 8, 5, 48, 26, 5, 16, 17, 0, 0, 2, 132, 53, 1, 16, 112, 6, 0, 0, 7, 2, 1, 48, 48, 15, 18, 31, 3, 0, 0, 9, 6, 10, 19, 27, 50, 46, 17, 9, 18, 1, 4, 48, 132, 23, 3, 5, 132, 9, 4, 3, 11, 0, 2, 46, 84, 12, 10, 10, 1, 0, 12, 76, 26, 22, 16, 26, 35, 15, 3, 16, 15, 1, 51, 132, 125, 8, 1, 2, 132, 51, 67, 91, 8, 0, 0, 30, 126, 39, 32, 38, 4, 0, 1, 12, 24, 2, 2, 2, 4, 7, 2, 19, 93, 19, 70, 92, 2, 3, 1, 21, 36, 58, 132, 94, 0, 0, 0, 0, 21, 25, 57, 48, 1, 0, 0, 1] 3 [0, 0, 0] 645 drop table if exists vector_index_08; 646 create table vector_index_08(a int primary key, b vecf32(3),c int); 647 insert into vector_index_08 values(1 ,"[1, 2, 3]",11); 648 insert into vector_index_08 values(2 ,"[1, 2, 3]",12); 649 insert into vector_index_08 values(3 ,"[1, 2, 3]",13); 650 create index idx01 using ivfflat on vector_index_08(b) lists = 2 op_type 'vector_l2_ops'; 651 alter table vector_index_08 add column d vecf32(3) not null after c; 652 select * from vector_index_08; 653 a b c d 654 1 [1, 2, 3] 11 [0, 0, 0] 655 2 [1, 2, 3] 12 [0, 0, 0] 656 3 [1, 2, 3] 13 [0, 0, 0] 657 drop table if exists vector_index_08; 658 create table vector_index_08(a int auto_increment primary key, b vecf32(3),c int); 659 insert into vector_index_08 values(1 ,"[1, 2, 3]",11); 660 insert into vector_index_08 values(2 ,"[1, 2, 3]",12); 661 insert into vector_index_08 values(3 ,"[1, 2, 3]",13); 662 create index idx01 using ivfflat on vector_index_08(b) lists = 2 op_type 'vector_l2_ops'; 663 alter table vector_index_08 add column d vecf32(3) not null after c; 664 select * from vector_index_08; 665 a b c d 666 1 [1, 2, 3] 11 [0, 0, 0] 667 2 [1, 2, 3] 12 [0, 0, 0] 668 3 [1, 2, 3] 13 [0, 0, 0] 669 drop table if exists vector_index_08; 670 create table vector_index_08(a int primary key, b vecf32(128),c int,key c_k(c)); 671 create index idx01 using ivfflat on vector_index_08(b) lists=3 op_type "vector_l2_ops"; 672 insert into vector_index_08 values(9774 ,"[1, 0, 1, 6, 6, 17, 47, 39, 2, 0, 1, 25, 27, 10, 56, 130, 18, 5, 2, 6, 15, 2, 19, 130, 42, 28, 1, 1, 2, 1, 0, 5, 0, 2, 4, 4, 31, 34, 44, 35, 9, 3, 8, 11, 33, 12, 61, 130, 130, 17, 0, 1, 6, 2, 9, 130, 111, 36, 0, 0, 11, 9, 1, 12, 2, 100, 130, 28, 7, 2, 6, 7, 9, 27, 130, 83, 5, 0, 1, 18, 130, 130, 84, 9, 0, 0, 2, 24, 111, 24, 0, 1, 37, 24, 2, 10, 12, 62, 33, 3, 0, 0, 0, 1, 3, 16, 106, 28, 0, 0, 0, 0, 17, 46, 85, 10, 0, 0, 1, 4, 11, 4, 2, 2, 9, 14, 8, 8]",3),(9775,"[0, 1, 1, 3, 0, 3, 46, 20, 1, 4, 17, 9, 1, 17, 108, 15, 0, 3, 37, 17, 6, 15, 116, 16, 6, 1, 4, 7, 7, 7, 9, 6, 0, 8, 10, 4, 26, 129, 27, 9, 0, 0, 5, 2, 11, 129, 129, 12, 103, 4, 0, 0, 2, 31, 129, 129, 94, 4, 0, 0, 0, 3, 13, 42, 0, 15, 38, 2, 70, 129, 1, 0, 5, 10, 40, 12, 74, 129, 6, 1, 129, 39, 6, 1, 2, 22, 9, 33, 122, 13, 0, 0, 0, 0, 5, 23, 4, 11, 9, 12, 45, 38, 1, 0, 0, 4, 36, 38, 57, 32, 0, 0, 82, 22, 9, 5, 13, 11, 3, 94, 35, 3, 0, 0, 0, 1, 16, 97]",5),(9776,"[10, 3, 8, 5, 48, 26, 5, 16, 17, 0, 0, 2, 132, 53, 1, 16, 112, 6, 0, 0, 7, 2, 1, 48, 48, 15, 18, 31, 3, 0, 0, 9, 6, 10, 19, 27, 50, 46, 17, 9, 18, 1, 4, 48, 132, 23, 3, 5, 132, 9, 4, 3, 11, 0, 2, 46, 84, 12, 10, 10, 1, 0, 12, 76, 26, 22, 16, 26, 35, 15, 3, 16, 15, 1, 51, 132, 125, 8, 1, 2, 132, 51, 67, 91, 8, 0, 0, 30, 126, 39, 32, 38, 4, 0, 1, 12, 24, 2, 2, 2, 4, 7, 2, 19, 93, 19, 70, 92, 2, 3, 1, 21, 36, 58, 132, 94, 0, 0, 0, 0, 21, 25, 57, 48, 1, 0, 0, 1]",3); 673 insert into vector_index_08 values(9777, "[16, 15, 0, 0, 5, 46, 5, 5, 4, 0, 0, 0, 28, 118, 12, 5, 75, 44, 5, 0, 6, 32, 6, 49, 41, 74, 9, 1, 0, 0, 0, 9, 1, 9, 16, 41, 71, 80, 3, 0, 0, 4, 3, 5, 51, 106, 11, 3, 112, 28, 13, 1, 4, 8, 3, 104, 118, 14, 1, 1, 0, 0, 0, 88, 3, 27, 46, 118, 108, 49, 2, 0, 1, 46, 118, 118, 27, 12, 0, 0, 33, 118, 118, 8, 0, 0, 0, 4, 118, 95, 40, 0, 0, 0, 1, 11, 27, 38, 12, 12, 18, 29, 3, 2, 13, 30, 94, 78, 30, 19, 9, 3, 31, 45, 70, 42, 15, 1, 3, 12, 14, 22, 16, 2, 3, 17, 24, 13]",4),(9778,"[41, 0, 0, 7, 1, 1, 20, 67, 9, 0, 0, 0, 0, 31, 120, 61, 25, 0, 0, 0, 0, 10, 120, 90, 32, 0, 0, 1, 13, 11, 22, 50, 4, 0, 2, 93, 40, 15, 37, 18, 12, 2, 2, 19, 8, 44, 120, 25, 120, 5, 0, 0, 0, 2, 48, 97, 102, 14, 3, 3, 11, 9, 34, 41, 0, 0, 4, 120, 56, 3, 4, 5, 6, 15, 37, 116, 28, 0, 0, 3, 120, 120, 24, 6, 2, 0, 1, 28, 53, 90, 51, 11, 11, 2, 12, 14, 8, 6, 4, 30, 9, 1, 4, 22, 25, 79, 120, 66, 5, 0, 0, 6, 42, 120, 91, 43, 15, 2, 4, 39, 12, 9, 9, 12, 15, 5, 24, 36]",4); 674 alter table vector_index_08 add column d vecf32(3) not null after c; 675 select * from vector_index_08; 676 a b c d 677 9774 [1, 0, 1, 6, 6, 17, 47, 39, 2, 0, 1, 25, 27, 10, 56, 130, 18, 5, 2, 6, 15, 2, 19, 130, 42, 28, 1, 1, 2, 1, 0, 5, 0, 2, 4, 4, 31, 34, 44, 35, 9, 3, 8, 11, 33, 12, 61, 130, 130, 17, 0, 1, 6, 2, 9, 130, 111, 36, 0, 0, 11, 9, 1, 12, 2, 100, 130, 28, 7, 2, 6, 7, 9, 27, 130, 83, 5, 0, 1, 18, 130, 130, 84, 9, 0, 0, 2, 24, 111, 24, 0, 1, 37, 24, 2, 10, 12, 62, 33, 3, 0, 0, 0, 1, 3, 16, 106, 28, 0, 0, 0, 0, 17, 46, 85, 10, 0, 0, 1, 4, 11, 4, 2, 2, 9, 14, 8, 8] 3 [0, 0, 0] 678 9775 [0, 1, 1, 3, 0, 3, 46, 20, 1, 4, 17, 9, 1, 17, 108, 15, 0, 3, 37, 17, 6, 15, 116, 16, 6, 1, 4, 7, 7, 7, 9, 6, 0, 8, 10, 4, 26, 129, 27, 9, 0, 0, 5, 2, 11, 129, 129, 12, 103, 4, 0, 0, 2, 31, 129, 129, 94, 4, 0, 0, 0, 3, 13, 42, 0, 15, 38, 2, 70, 129, 1, 0, 5, 10, 40, 12, 74, 129, 6, 1, 129, 39, 6, 1, 2, 22, 9, 33, 122, 13, 0, 0, 0, 0, 5, 23, 4, 11, 9, 12, 45, 38, 1, 0, 0, 4, 36, 38, 57, 32, 0, 0, 82, 22, 9, 5, 13, 11, 3, 94, 35, 3, 0, 0, 0, 1, 16, 97] 5 [0, 0, 0] 679 9776 [10, 3, 8, 5, 48, 26, 5, 16, 17, 0, 0, 2, 132, 53, 1, 16, 112, 6, 0, 0, 7, 2, 1, 48, 48, 15, 18, 31, 3, 0, 0, 9, 6, 10, 19, 27, 50, 46, 17, 9, 18, 1, 4, 48, 132, 23, 3, 5, 132, 9, 4, 3, 11, 0, 2, 46, 84, 12, 10, 10, 1, 0, 12, 76, 26, 22, 16, 26, 35, 15, 3, 16, 15, 1, 51, 132, 125, 8, 1, 2, 132, 51, 67, 91, 8, 0, 0, 30, 126, 39, 32, 38, 4, 0, 1, 12, 24, 2, 2, 2, 4, 7, 2, 19, 93, 19, 70, 92, 2, 3, 1, 21, 36, 58, 132, 94, 0, 0, 0, 0, 21, 25, 57, 48, 1, 0, 0, 1] 3 [0, 0, 0] 680 9777 [16, 15, 0, 0, 5, 46, 5, 5, 4, 0, 0, 0, 28, 118, 12, 5, 75, 44, 5, 0, 6, 32, 6, 49, 41, 74, 9, 1, 0, 0, 0, 9, 1, 9, 16, 41, 71, 80, 3, 0, 0, 4, 3, 5, 51, 106, 11, 3, 112, 28, 13, 1, 4, 8, 3, 104, 118, 14, 1, 1, 0, 0, 0, 88, 3, 27, 46, 118, 108, 49, 2, 0, 1, 46, 118, 118, 27, 12, 0, 0, 33, 118, 118, 8, 0, 0, 0, 4, 118, 95, 40, 0, 0, 0, 1, 11, 27, 38, 12, 12, 18, 29, 3, 2, 13, 30, 94, 78, 30, 19, 9, 3, 31, 45, 70, 42, 15, 1, 3, 12, 14, 22, 16, 2, 3, 17, 24, 13] 4 [0, 0, 0] 681 9778 [41, 0, 0, 7, 1, 1, 20, 67, 9, 0, 0, 0, 0, 31, 120, 61, 25, 0, 0, 0, 0, 10, 120, 90, 32, 0, 0, 1, 13, 11, 22, 50, 4, 0, 2, 93, 40, 15, 37, 18, 12, 2, 2, 19, 8, 44, 120, 25, 120, 5, 0, 0, 0, 2, 48, 97, 102, 14, 3, 3, 11, 9, 34, 41, 0, 0, 4, 120, 56, 3, 4, 5, 6, 15, 37, 116, 28, 0, 0, 3, 120, 120, 24, 6, 2, 0, 1, 28, 53, 90, 51, 11, 11, 2, 12, 14, 8, 6, 4, 30, 9, 1, 4, 22, 25, 79, 120, 66, 5, 0, 0, 6, 42, 120, 91, 43, 15, 2, 4, 39, 12, 9, 9, 12, 15, 5, 24, 36] 4 [0, 0, 0] 682 SET GLOBAL experimental_ivf_index = 0; 683 drop database vecdb2;