Database / Milvus Vector database Interview questions
What is a Partition in Milvus?
A Partition is a logical subdivision within a Collection, letting related entities be grouped together so a search or load operation can be scoped to just the relevant subset instead of the entire collection.
client.create_partition(collection_name="products", partition_name="electronics") client.create_partition(collection_name="products", partition_name="clothing") client.insert( collection_name="products", partition_name="electronics", data=[{"id": 1, "embedding": [...], "category": "electronics"}] ) results = client.search( collection_name="products", partition_names=["electronics"], data=[query_vector], limit=5 )
Partitions are commonly used for multi-tenant applications (one partition per customer or tenant) or for time-based data (one partition per day or month), where search queries typically only need to touch a known subset of the data; scoping a search to specific partitions reduces the amount of data that has to be scanned, directly improving both search latency and resource usage.
More Related questions...