Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCUMENTATION: ivfflat unavailable for sparse vectors with pgvector #25

Open
RonanKMcGovern opened this issue Dec 9, 2024 · 0 comments

Comments

@RonanKMcGovern
Copy link

Documents suggest

3.  (Optional) Create a vector index on the sparse vector column.

CREATE INDEX ON documents USING vectors (embedding svector\_dot\_ops); \-- for pgvecto.rs users
CREATE INDEX ON documents USING ivfflat (embedding sparsevec\_ip\_ops); \-- for pgvector users

but I don't believe there is ivfflat for sparse vectors with pgvector since:

SELECT am.amname, opc.opcname, opc.opcintype::regtype
FROM pg_am am 
JOIN pg_opclass opc ON opc.opcmethod = am.oid
WHERE opc.opcintype::regtype::text = 'sparsevec'
ORDER BY am.amname, opc.opcname;
 amname |       opcname        | opcintype 
--------+----------------------+-----------
 btree  | sparsevec_ops        | sparsevec
 hnsw   | sparsevec_cosine_ops | sparsevec
 hnsw   | sparsevec_ip_ops     | sparsevec
 hnsw   | sparsevec_l1_ops     | sparsevec
 hnsw   | sparsevec_l2_ops     | sparsevec

Is there a workaround OR does one have to add the pgvecto.rs extension? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant