milvus-logo

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
curl -X 'DELETE' \
  'http://localhost:9091/api/v1/partitions/load' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
    "collection_name": "book",
    "partition_names": ["novel"],
    "replica_number": 1
  }'
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 release.
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.
Parameter Description
collection_name Name of the collection to release partitions.
partition_names List of names of the partitions 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

Is this page helpful?
On this page