Skip to content

Commit

Permalink
Merge pull request #1195 from yangj1211/fixindex
Browse files Browse the repository at this point in the history
fix vec index
  • Loading branch information
yangj1211 authored Dec 17, 2024
2 parents 0ef2db4 + d085198 commit ad7bc1d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/MatrixOne/Develop/Vector/vector_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ SET GLOBAL experimental_ivf_index = 1;

```python
import numpy as np
import ollama
import pymysql.cursors
import time

Expand Down Expand Up @@ -109,12 +108,13 @@ def vec_search(vector_dim,topk):
def vec_indx(n):
index_sql = 'create index idx_vec using ivfflat on vec_table(vec) lists=%s op_type "vector_l2_ops"'
cursor.execute(index_sql, n)
conn.commit()

if __name__ == "__main__":
insert_data(128, 2000000, 10000)
print("未创建向量索引 SQL 执行时间:")
vec_search(128,3)
print("创建向量中......")
print("创建向量索引中......")
vec_indx(1000)
print("已创建向量索引 SQL 执行时间:")
vec_search(128,3)
Expand Down

0 comments on commit ad7bc1d

Please sign in to comment.