id: release_collection.md
related_key: release collection
summary: Learn how to release a collection from memory in Milvus.
释放 Collection
当前主题介绍如何在搜索或查询后从内存中释放 collection 以减少内存使用。
{{fragments/multiple_code.md}}
from pymilvus import Collectioncollection = Collection("book") # Get an existing collection.collection.release()
await milvusClient.collectionManager.releaseCollection({ collection_name: "book",});
err := milvusClient.ReleaseCollection( context.Background(), // ctx "book", // CollectionName )if err != nil { log.Fatal("failed to release collection:", err.Error())}
milvusClient.releaseCollection( ReleaseCollectionParam.newBuilder() .withCollectionName("book") .build());
release -c book
| 参数 |
说明 |
partition_name (optional) |
要释放的 partition 名称。 |
| 参数 |
说明 |
collection_name |
要释放的 collection 名称。 |
| 参数 |
说明 |
ctx |
控制调用 API 的 Context。 |
CollectionName |
要释放的 collection 名称。 |
| 参数 |
描述 |
CollectionName |
要释放的 collection 名称。 |
| 选项 |
描述 |
| -c |
要释放的 collection 名称。 |
| -p (Optional/Multiple) |
要释放的 partition 名称。 |
更多内容
- 了解更多 Milvus 的基本操作:
- 探索 Milvus SDK 的 API 参考: