milvus-logo
LFAI
Home
  • User Guide

Release a Partition

This topic describes how to release a partition from memory after a search or a query to reduce memory usage.

from pymilvus import Partition
partition = Partition("novel")       # Get an existing partition.
partition.release()
await milvusClient.partitionManager.releasePartitions({
    collection_name: "book",
    partition_names: ["novel"],
 });
err := milvusClient.ReleasePartitions(
  context.Background(),   // ctx
  "book",                 // CollectionName
  []string{"novel"}       // partitionNames
)
if err != nil {
  log.Fatal("failed to release partitions:", err.Error())
}
milvusClient.releasePartitions(
  ReleasePartitionsParam.newBuilder()
    .withCollectionName("book")
    .withPartitionNames(["novel"])
    .build()
);
release -c book -p novel
Parameter Description
partition_name Name of the partition.
Parameter Description
collection_name Name of the collection to release partitions.
partition_names List of names of the partitions to load.
Parameter Description
ctx Context to control API invocation process.
CollectionName Name of the collection to release partitions.
partitionNames List of names of the partitions to release.
Parameter Description
CollectionName Name of the collection to release partition.
PartitionNames List of names of the partitions to release.
Option Description
-c Name of the collection to release partition.
-p (Multiple) The name of the partition to release.

Constraints

  • Error will be returned at the attempt to load partition(s) when the parent collection is already loaded. Future releases will support releasing partitions from a loaded collection, and (if needed) then loading some other partition(s).
  • “Load successfully” will be returned at the attempt to load the collection that is already loaded.
  • Error will be returned at the attempt to load the collection when the child partition(s) is/are already loaded. Future releases will support loading the collection when some of its partitions are already loaded.
  • Loading different partitions in a same collection via separate RPCs is not allowed.

What’s next

Try Managed Milvus for Free

Zilliz Cloud is hassle-free, powered by Milvus and 10x faster.

Get Started
Feedback

Was this page helpful?