forked from tensorchord/pgvecto.rs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add optimizing_threads to function (tensorchord#375)
* feat: add optiming_threads to index Signed-off-by: cutecutecat <junyuchen@tensorchord.ai> * put flexible at IndexProtect Signed-off-by: cutecutecat <junyuchen@tensorchord.ai> * fix by comments Signed-off-by: cutecutecat <junyuchen@tensorchord.ai> --------- Signed-off-by: cutecutecat <junyuchen@tensorchord.ai> Signed-off-by: jinweios <jinwei.peng@beingthink.com>
- Loading branch information
1 parent
9227095
commit 4e6744f
Showing
12 changed files
with
180 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
statement ok | ||
SET search_path TO pg_temp, vectors; | ||
|
||
statement ok | ||
CREATE TABLE t (val vector(3)); | ||
|
||
statement ok | ||
INSERT INTO t (val) SELECT ARRAY[random(), random(), random()]::real[] FROM generate_series(1, 1000); | ||
|
||
statement ok | ||
CREATE INDEX hnsw_1 ON t USING vectors (val vector_l2_ops) | ||
WITH (options = "[indexing.hnsw]"); | ||
|
||
query I | ||
SELECT COUNT(1) FROM (SELECT 1 FROM t ORDER BY val <#> '[0.5,0.5,0.5]' limit 10) t2; | ||
---- | ||
10 | ||
|
||
statement error does not exist | ||
SELECT alter_vector_index('unknown_index'::regclass::oid, 'optimizing.threads', '1'); | ||
|
||
statement error Setting key | ||
SELECT alter_vector_index('hnsw_1'::regclass::oid, 'unknown_key', '1'); | ||
|
||
statement error wrong value | ||
SELECT alter_vector_index('hnsw_1'::regclass::oid, 'optimizing.threads', 'unknown_value'); | ||
|
||
statement ok | ||
SELECT alter_vector_index('hnsw_1'::regclass::oid, 'optimizing.threads', '1'); | ||
|
||
query I | ||
SELECT COUNT(1) FROM (SELECT 1 FROM t ORDER BY val <#> '[0.5,0.5,0.5]' limit 10) t2; | ||
---- | ||
10 | ||
|
||
statement ok | ||
DROP TABLE t; |