pgvector / pgvector-python

pgvector support for Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to rebuild indexes with Django?

lesser-panda opened this issue · comments

Newbie questions here,

I am planning to use pgvector with Django. I am wondering how should I rebuild a IVFFLAT or HNSW index as I add more embeddings to the database?

Hi @lesser-panda, indexes are updated incrementally, so you shouldn't need to reindex in many cases, but if needed, you can run:

REINDEX INDEX CONCURRENTLY index_name;

https://www.postgresql.org/docs/current/sql-reindex.html

Hi @lesser-panda, indexes are updated incrementally, so you shouldn't need to reindex in many cases, but if needed, you can run:

REINDEX INDEX CONCURRENTLY index_name;

https://www.postgresql.org/docs/current/sql-reindex.html

@ankane Thanks for the quick reply! Very helpful.