Coder Social home page Coder Social logo

Query not using IVFFLAT index about pgvector HOT 4 CLOSED

xfalcox avatar xfalcox commented on June 14, 2024
Query not using IVFFLAT index

from pgvector.

Comments (4)

xfalcox avatar xfalcox commented on June 14, 2024

After going into a rabbit hole, this is caused by an abnormal high ivfflat.probes parameter.

I automated index creation at

https://github.com/discourse/discourse-ai/blob/main/lib/embeddings/vector_representations/base.rb#L23-L108

but since that we have also added another table for post embeddings. There are many more posts than topics, and the automation was setting probes based on the number of posts globally.

In the end this is yet another point for #235, which would make the ergonomics much simpler to reason about.

from pgvector.

jkatz avatar jkatz commented on June 14, 2024

@xfalcox Curious -- is there a reason you went with IVFFLAT instead of HNSW?

from pgvector.

xfalcox avatar xfalcox commented on June 14, 2024

Well, @jkatz, HNSW wasn't a thing when I started doing this, I think most of my databases both in-house and in RDS are below pgvector 0.5 still.

I'd like to experiment with it, but with all the moving pieces, we running embeddings backfill and indexing automatically on many instances, with some hosted by us and some hosted by people running our software which may not be as technical, I need something that is as hands-free and safe as possible.

from pgvector.

jkatz avatar jkatz commented on June 14, 2024

@xfalcox Thanks for the explanation, that's really helpful! One nice thing about HNSW is that it's a bit easier to maintain, because it supports iterative inserts/updates, so you don't have to have the dataset pre-loaded like with IVFFLAT. From observations and talking to users, HNSW tends to be easier for folks who are less familiar with working with approximate nearest neighbor indexing.

Amazon RDS does support pgvector 0.5 and above since Oct 23 (Disclosure, I work at AWS).

Hope this helps. I'm also happy to hear more about your experience working with pgvector.

from pgvector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.