Database / Milvus Vector database Interview questions
What is loading a collection in Milvus, and why is it required before search?
Before a collection can be searched, its relevant segments need to be loaded into memory (or made accessible via mmap) on one or more Query Nodes; a collection that exists and has data inserted into it isn't automatically searchable until this explicit load step happens.
client.load_collection(collection_name="products") results = client.search( collection_name="products", data=[query_vector], limit=5 ) client.release_collection(collection_name="products")
This explicit load/release separation exists because loading a large collection consumes meaningful memory and compute resources on Query Nodes; keeping every collection loaded at all times, even ones rarely queried, would waste resources unnecessarily. Releasing a collection frees those resources back up, which matters for deployments juggling many collections where only a subset are actively being queried at any given time, particularly relevant to Milvus's support for tens of thousands of collections in a single cluster.
More Related questions...