You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/service/common/vectorStore/pg/class.ts
+24-6Lines changed: 24 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -21,23 +21,24 @@ export class PgVectorCtrl {
21
21
CREATE EXTENSION IF NOT EXISTS vector;
22
22
CREATE TABLE IF NOT EXISTS ${DatasetVectorTableName} (
23
23
id BIGSERIAL PRIMARY KEY,
24
-
vector VECTOR(1536) NOT NULL,
24
+
halfvector HALFVEC(1536) NOT NULL,
25
25
team_id VARCHAR(50) NOT NULL,
26
26
dataset_id VARCHAR(50) NOT NULL,
27
27
collection_id VARCHAR(50) NOT NULL,
28
28
createtime TIMESTAMP DEFAULT CURRENT_TIMESTAMP
29
29
);
30
30
`);
31
31
32
-
awaitPgClient.query(
33
-
`CREATE INDEX CONCURRENTLY IF NOT EXISTS vector_index ON ${DatasetVectorTableName} USING hnsw (vector vector_ip_ops) WITH (m = 32, ef_construction = 128);`
34
-
);
35
32
awaitPgClient.query(
36
33
`CREATE INDEX CONCURRENTLY IF NOT EXISTS team_dataset_collection_index ON ${DatasetVectorTableName} USING btree(team_id, dataset_id, collection_id);`
37
34
);
38
35
awaitPgClient.query(
39
36
`CREATE INDEX CONCURRENTLY IF NOT EXISTS create_time_index ON ${DatasetVectorTableName} USING btree(createtime);`
40
37
);
38
+
// TODO: enable halfvector index
39
+
// await PgClient.query(
40
+
// `CREATE INDEX CONCURRENTLY IF NOT EXISTS halfvector_index ON ${DatasetVectorTableName} USING hnsw (halfvector halfvec_ip_ops) WITH (m = 32, ef_construction = 128);`
0 commit comments