A collection is composed of two main components: the data storage and the indexing structure.
A data storage component organizes the vector data for efficient storage and retrieval. In addition, it typically employs various techniques like compression and serialization to optimize the storage requirements.
On the other hand, the indexing structure is responsible for accelerating the similarity search operations. It organizes the vectors to enable the fast search and retrieval based on similarity.
When working with Milvus collections, you will encounter such scenarios where you must gather an information about the collection.
In this tutorial, we will learn how to use the “describe” command in the Milvus CLI to gather a detailed information about a given collection.
Create a Sample Collection in Milvus
Let us start by setting up a sample Milvus collection for demonstration purposes.
Start by opening the Milvus CLI with the following command:
Next, log in to your Milvus instance with the following command:
For example, the following command logs into a locally hosted Milvus instance on the default port and alias:
Output:
+---------+---------------------+
| Address | 192.168.100.2:19530 |
| User | |
| Alias | default |
Once logged in, we can create a sample Milvus collection as shown in the following command:
The previous command should create a new film collection with the defined schema fields and types.
Show the Collection Info in Milvus
To show the collection information using the Milvus CLI, we can use the “describe” command as shown in the following syntax:
The -c option denotes the target collection name.
For example, to show an information about the film collection, we can run the following command:
This should return the details about the collection as follows:
| Name | film |
+---------------+-------------------------------------+
| Description | 'fiml_collection' |
+---------------+-------------------------------------+
| Is Empty | False |
+---------------+-------------------------------------+
| Entities | 8657 |
+---------------+-------------------------------------+
| Primary Field | id |
+---------------+-------------------------------------+
| Schema | Description: 'fiml_collection' |
| | |
| | Auto ID: False |
| | |
| | Fields(* is the primary field): |
| | - *id INT64 primary_field |
| | - film_name VARCHAR |
| | - release_year INT64 release_year |
| | - vector FLOAT_VECTOR dim: 8 |
+---------------+-------------------------------------+
| Partitions | - _default |
+---------------+-------------------------------------+
| Indexes | - vector |
+---------------+-------------------------------------+
The command returns a detailed information about the collection including the available partitions, indexes, number of entries, empty state, and the schema layout.
Conclusion
In this post, you learned how to use the “describe” command in the Milvus CLI to gather the detailed information about a given database collection.