-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
57 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
vectorscale--0.3.0--0.4.0.sql |
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 @@ | ||
vectorscale--0.3.0--0.4.0.sql |
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,55 @@ | ||
/* <begin connected objects> */ | ||
/* | ||
This file is auto generated by pgrx. | ||
The ordering of items is not stable, it is driven by a dependency graph. | ||
*/ | ||
/* </end connected objects> */ | ||
|
||
/* <begin connected objects> */ | ||
-- src/access_method/mod.rs:26 | ||
-- vectorscale::access_method::amhandler | ||
|
||
CREATE OR REPLACE FUNCTION diskann_amhandler(internal) RETURNS index_am_handler PARALLEL SAFE IMMUTABLE STRICT COST 0.0001 LANGUAGE c AS '$libdir/vectorscale-0.4.0', 'amhandler_wrapper'; | ||
|
||
DO $$ | ||
DECLARE | ||
c int; | ||
BEGIN | ||
SELECT count(*) | ||
INTO c | ||
FROM pg_catalog.pg_am a | ||
WHERE a.amname = 'diskann'; | ||
|
||
IF c = 0 THEN | ||
CREATE ACCESS METHOD diskann TYPE INDEX HANDLER diskann_amhandler; | ||
END IF; | ||
END; | ||
$$; | ||
/* </end connected objects> */ | ||
|
||
/* <begin connected objects> */ | ||
-- src/access_method/mod.rs:89 | ||
-- requires: | ||
-- amhandler | ||
|
||
|
||
DO $$ | ||
DECLARE | ||
c int; | ||
BEGIN | ||
SELECT count(*) | ||
INTO c | ||
FROM pg_catalog.pg_opclass c | ||
WHERE c.opcname = 'vector_cosine_ops' | ||
AND c.opcmethod = (SELECT oid FROM pg_catalog.pg_am am WHERE am.amname = 'diskann'); | ||
|
||
IF c = 0 THEN | ||
CREATE OPERATOR CLASS vector_cosine_ops DEFAULT | ||
FOR TYPE vector USING diskann AS | ||
OPERATOR 1 <=> (vector, vector) FOR ORDER BY float_ops; | ||
END IF; | ||
END; | ||
$$; | ||
/* </end connected objects> */ | ||
|