Skip to content

MultiIndex on PGVector #743

@svim-ig

Description

@svim-ig

I created IVF Flat Index and HNSW index on the same column i.e.product embeddings ...got info from postgress that query planner will use index in case of multi indexed columns based on cost. However, when i do explain analyze for 10 query texts...i always got HNSW index used everytime...do HNSW index always having less cost compared to IVF Index???

cur.execute("""
EXPLAIN ANALYZE
SELECT *
FROM product_embeddings_table
ORDER BY product_embeddings <-> %s
LIMIT 10
""", (query_vector,))

Fetch the query execution plan
explain_results = cur.fetchall()

for row in explain_results:
print(row)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions