Create Vector Index
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
gpdb:CreateVectorIndex | create |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
DBInstanceId | string | Yes | Instance ID. Note
You can call the DescribeDBInstances API to view details of all AnalyticDB PostgreSQL instances in the target region, including the instance ID.
| gp-xxxxxxxxx |
Collection | string | Yes | Collection name. Note
You can use the ListCollections API to view the list.
| document |
Dimension | integer | Yes | Vector dimension. Note
This value must be consistent with the length of the vector data (Rows. Vector) uploaded via the UpsertCollectionData API.
| 1024 |
ManagerAccount | string | Yes | Name of the management account with rds_superuser permissions. Note
You can create an account through the console -> Account Management, or by using the CreateAccount API.
| testaccount |
ManagerAccountPassword | string | Yes | Management account password. | testpassword |
Metrics | string | No | Method used for building the vector index. Value description:
| cosine |
Namespace | string | No | Namespace, default is public. Note
You can use the ListNamespaces API to view the list.
| mynamespace |
RegionId | string | Yes | Region ID where the instance is located. | cn-hangzhou |
PqEnable | integer | No | Whether to enable PQ (Product Quantization) algorithm acceleration for the index. It is recommended to enable this when the data volume exceeds 500,000. Value description:
| 1 |
HnswM | integer | No | The maximum number of neighbors in the HNSW algorithm, ranging from 1 to 1000. The API will automatically set this value based on the vector dimension, and it generally does not need to be manually set. Note
It is suggested to set this based on the vector dimension as follows:
| 64 |
ExternalStorage | integer | No | Whether to use mmap to build the HNSW index, default is 0. If the data does not need to be deleted and there are performance requirements for uploading data, it is recommended to set this to 1. Note
| 0 |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "ABB39CC3-4488-4857-905D-2E4A051D0521",
"Message": "Successful",
"Status": "success"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2024-01-09 | The request parameters of the API has changed | View Change Details |
2023-11-07 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
2023-08-08 | The request parameters of the API has changed | View Change Details |