All Products
Search
Document Center

AnalyticDB:CreateVectorIndex

Last Updated:Sep 12, 2024

Creates a vector index.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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.
OperationAccess levelResource typeCondition keyAssociated operation
gpdb:CreateVectorIndexcreate
  • Collection
    acs:gpdb:{#regionId}:{#accountId}:collection/{#DBInstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
MetricsstringNo

The method that is used to create vector indexes.Valid values:

  • l2: Euclidean distance.

  • ip: inner product distance.

  • cosine: cosine similarity.

cosine
PqEnableintegerNo

Specifies whether to enable the product quantization (PQ) feature for index acceleration. We recommend that you enable this feature for more than 500,000 rows of data. Valid values:

  • 0: no.
  • 1 (default): yes.
1
HnswMintegerNo

The maximum number of neighbors for the Hierarchical Navigable Small World (HNSW) algorithm. Valid values: 1 to 1000. In most cases, this parameter is automatically configured based on the value of the Dimension parameter. You do not need to configure this parameter.

Note We recommend that you configure this parameter based on the value of the Dimension parameter.
  • If you set Dimension to a value less than or equal to 384, set the value of HnswM to 16.

  • If you set Dimension to a value greater than 384 and less than or equal to 768, set the value of HnswM to 32.

  • If you set Dimension to a value greater than 768 and less than or equal to 1024, set the value of HnswM to 64.

  • If you set Dimension to a value greater than 1024, set the value of HnswM to 128.

64
ExternalStorageintegerNo

Specifies whether to use the memory mapping technology to create HNSW indexes. Valid values: 0 and 1. Default value: 0. We recommend that you set the value to 1 in scenarios that require upload speed but not data deletion.

  • 0: uses segmented paging storage to create indexes. This method uses the shared buffer of PostgreSQL for caching and supports the delete and update operations.

  • 1: uses the memory mapping technology to create indexes. This method does not support the delete or update operation.

0

Response parameters

ParameterTypeDescriptionExample
The current API has no return parameters

Examples

Sample success responses

JSONformat

{
  "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 timeSummary of changesOperation
2024-01-09The request parameters of the API has changedView Change Details
2023-11-07The internal configuration of the API is changed, but the call is not affectedView Change Details
2023-08-08The request parameters of the API has changedView Change Details