Find answers from the community

Updated 5 months ago

It works well but I think every time I

It works well but I think every time I enter the if condition to get an index from an existing vector store, a new index is created in the database like you can see in this capture (the last lines data_..idx..).

Plain Text
vector_db=# \d+ data_paul_graham_essay;
                                                              Table "public.data_paul_graham_essay"
  Column   |       Type        | Collation | Nullable |                      Default                       | Storage  | Compression | Stats target | Description 
-----------+-------------------+-----------+----------+----------------------------------------------------+----------+-------------+--------------+-------------
 id        | bigint            |           | not null | nextval('data_paul_graham_essay_id_seq'::regclass) | plain    |             |              | 
 text      | character varying |           | not null |                                                    | extended |             |              | 
 metadata_ | json              |           |          |                                                    | extended |             |              | 
 node_id   | character varying |           |          |                                                    | extended |             |              | 
 embedding | vector(1024)      |           |          |                                                    | external |             |              | 
Indexes:
    "data_paul_graham_essay_pkey" PRIMARY KEY, btree (id)
    "data_paul_graham_essay_embedding_idx" hnsw (embedding vector_cosine_ops) WITH (m='16', ef_construction='64')
    "data_paul_graham_essay_embedding_idx1" hnsw (embedding vector_cosine_ops) WITH (m='16', ef_construction='64')
    "data_paul_graham_essay_embedding_idx2" hnsw (embedding vector_cosine_ops) WITH (m='16', ef_construction='64')
Access method: heap


I'm not sure this is normal. does anyone have any idea what's going on? Thank you in advance πŸ™‚
l
1 comment
ok, it seems like when getting the vector_store with PGVectorStore.from_params we have to pass perform_setup=False to avoid the modification of the table πŸ˜…
Add a reply
Sign up and join the conversation on Discord