Database / Qdrant Vector DB Interview questions
What is the purpose of a payload index?
A payload index is a dedicated index built on a specific payload field, letting Qdrant quickly find points matching a filter condition on that field without scanning every point's payload for every query — the payload equivalent of the HNSW index's role for vector similarity.
client.create_payload_index( collection_name="documents", field_name="category", field_schema=models.PayloadSchemaType.KEYWORD, )
Without an index, filtering on a field requires checking every point's payload individually to see whether it satisfies the filter condition, which becomes noticeably slower as a collection grows into the millions of points; with an index, Qdrant can directly look up which points satisfy a condition, similar in spirit to an index in a relational database.
Qdrant recommends indexing fields that are frequently filtered on and that meaningfully narrow down the result set — a highly selective field like a unique object ID benefits more from indexing than a low-cardinality field with only a handful of possible values — and it automatically factors available indexes and filter selectivity into how it plans and executes a query.
More Related questions...