All Products
Search
Document Center

Tablestore:Delete a secondary index

Last Updated:Apr 30, 2026

Call the DeleteIndex operation to delete a secondary index from a data table. Once deleted, the index cannot be restored.

Usage notes

Deleted secondary indexes cannot be restored. To use the index again, recreate it.

API operation

/**
 * Delete a global secondary index.
 * @api
 *
 * @param [] $request
 *            The request parameters, including the name of the data table.
 * @return [] The response.
 * @throws OTSClientException Thrown when a parameter error occurs or the Tablestore server returns a verification error.
 * @throws OTSServerException Thrown when the Tablestore server returns an error.
 * @example "src/examples/DropIndex.php"
 */
public function dropIndex(array $request)

Parameters

Parameter

Description

table_name

The name of the data table.

index_name

The name of the index table.

Examples

The following example deletes a secondary index:

$request = array(
    'table_name' => '<TABLE_NAME>', // The name of the data table.
    'index_name' => '<INDEX_NAME>'  // The name of the index table.
);
$otsClient->dropIndex($request);