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

diskann does not support vector_ip_ops despite documentation #199

Open
SlaveRHNH opened this issue Feb 12, 2025 · 3 comments
Open

diskann does not support vector_ip_ops despite documentation #199

SlaveRHNH opened this issue Feb 12, 2025 · 3 comments
Labels
bug Something isn't working community pgvectorscale

Comments

@SlaveRHNH
Copy link

What happened?

I'm trying to create an index using diskann with vector_ip_ops in pgvectorscale, but it fails with the following error:

ERROR: operator class "vector_ip_ops" does not exist for access method "diskann"

However, the pgvectorscale documentation states that diskann should support vector_ip_ops for inner product (<#>) queries.
Additionally, I see the note:

"inner product indices are not compatible with plain storage"

So I attempted to create the index using bq_compression and bq_speedup, but I still get the same error.

pgvectorscale extension affected

0.5.1

PostgreSQL version used

17.2

What operating system did you use?

Ubuntu 22.04 x64

What installation method did you use?

Docker

What platform did you run on?

On prem/Self-hosted

Relevant log output and stack trace

ERROR:  operator class "vector_ip_ops" does not exist for access method "diskann"

How can we reproduce the bug?

DROP INDEX IF EXISTS posts_embedding_idx;
CREATE INDEX posts_embedding_idx ON posts 
USING diskann (embedding vector_ip_ops) 
WITH (storage_layout = 'bq_speedup');

Are you going to work on the bugfix?

🆘 No, could someone else please work on the bugfix?

@SlaveRHNH SlaveRHNH added bug Something isn't working community pgvectorscale labels Feb 12, 2025
@tjgreen42
Copy link
Contributor

Hi, was this a clean install of the extension, or an upgrade? Wondering if there might be a bug in the latter codepath causing the operator class not to be installed.

@SlaveRHNH
Copy link
Author

Hi,

I used the following Docker image for PostgreSQL with TimescaleDB:

version: '3.8'

services:
  db:
    image: timescale/timescaledb-ha:pg17
    container_name: postgres_db
    environment:
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: mysecretpassword
      POSTGRES_DB: mydatabase
    ports:
      - "5432:5432"
    volumes:
      - pg_data:/var/lib/postgresql/data

volumes:
  pg_data:
    driver: local

After setting up the database, I created the vectorscale extension with:

CREATE EXTENSION IF NOT EXISTS vectorscale CASCADE;

Then, I created the tables:

CREATE TABLE IF NOT EXISTS users (
    id SERIAL PRIMARY KEY,
    embedding VECTOR(7)
);

CREATE TABLE IF NOT EXISTS posts (
    id SERIAL PRIMARY KEY,
    embedding VECTOR(7)
);

Finally, I attempted to create an index using diskann with vector_ip_ops:

CREATE INDEX posts_embedding_idx ON posts 
USING diskann (embedding vector_ip_ops) 
WITH (storage_layout = 'bq_compression');

However, I encountered the following error:

ERROR: operator class "vector_ip_ops" does not exist for access method "diskann"

At the same time, I was able to successfully create indexes for cosine similarity and L2 distance.

@SlaveRHNH
Copy link
Author

@tjgreen42 @cevian Hi! Just wanted to follow up on this issue. Have you had a chance to take a look? Let me know if you need any additional information or testing from my side—happy to help. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working community pgvectorscale
Projects
None yet
Development

No branches or pull requests

2 participants