Creates a scalar index on a collection. The table is write-locked during index creation. For tables with large data volumes, index creation consumes significant CPU and I/O resources. If this impacts instance availability, call CancelCreateIndexJob to cancel the operation.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
gpdb:CreateIndex |
create |
*Collection
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| RegionId |
string |
Yes |
The region ID of the instance. |
cn-hangzhou |
| DBInstanceId |
string |
No |
The cluster ID. Note
You can call the DescribeDBInstances operation to query the IDs of all AnalyticDB for PostgreSQL instances in the specified region. |
gp-xxxxxxxxx |
| WorkspaceId |
string |
No |
The workspace ID. A workspace consists of multiple AnalyticDB for PostgreSQL instances. You must specify this parameter or DBInstanceId. If both are specified, this parameter takes precedence. Valid values:
|
gp-ws-***** |
| Namespace |
string |
Yes |
The namespace name. Note
You can call the ListNamespaces operation to query a list of namespaces. |
mynamespace |
| NamespacePassword |
string |
Yes |
The password of the namespace. Note
This value is set when you call the CreateNamespace operation. |
testpassword |
| Collection |
string |
Yes |
The name of the collection. Note
You can call the ListCollections operation to query a list of collections. |
testcollection |
| IndexName |
string |
No |
The name of the index. |
testindex |
| IndexField |
string |
No |
The field to index. Only a single field is supported, and it must be a metadata key. |
title |
| IndexConfig |
string |
No |
The index configuration. If not specified, a B-tree index is created. Note
|
{"b-tree":{"fillFactor":90}} or {"gin":{"fastUpdate":false}} |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
ABB39CC3-4488-4857-905D-2E4A051D0521 |
| Message |
string |
The response message. |
Successfully create job |
| Status |
string |
The status of the operation. Valid values:
|
success |
| JobId |
string |
The job ID. You can use this ID to query the job status or cancel the job. |
231460f8-75dc-405e-a669-0c5204887e91 |
Examples
Success response
JSON format
{
"RequestId": "ABB39CC3-4488-4857-905D-2E4A051D0521",
"Message": "Successfully create job",
"Status": "success",
"JobId": "231460f8-75dc-405e-a669-0c5204887e91"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.