What is Vector Index (pgvector)?

Turkish: Vektör İndeks (pgvector)

A vector index speeds up similarity search by organizing embeddings so nearest neighbors can be found efficiently at scale.

What is Vector Index (pgvector)?

A vector index is used to find the most similar records among text, image, or product embeddings. A normal database index looks for exact or ordered values; a vector index answers “which records are semantically closest to this query?”

How It Works

Each document, product description, or support ticket is passed through an embedding model and stored as a high-dimensional numeric vector. At search time, the user query is converted into a vector as well. The system compares vectors with measures such as cosine similarity, inner product, or L2 distance.

For small datasets, a full scan may be acceptable. As data grows, approximate nearest-neighbor indexes such as HNSW or IVFFlat reduce search time. pgvector brings HNSW and IVFFlat vector indexes into PostgreSQL.

Where It Is Used

RAG knowledge assistants, product similarity, semantic document search, support-ticket matching, and recommendation systems use vector indexes. The quality of the embedding strongly affects result quality. Running pgvector on PostgreSQL can keep relational data and vector search in the same database.

For very large volumes, very low latency, or specialized scaling needs, a separate vector database may be a better fit.