Todos os produtos
Search
Central de documentação

Tablestore:Delete a secondary index

Última atualização: Sep 20, 2026

Use o Tablestore SDK for PHP para excluir um índice secundário global ou local sem afetar a tabela de dados nem seus dados.

Precauções

Um índice secundário excluído não pode ser recuperado. Para usá-lo novamente, crie um novo índice secundário.

Operação da API

/**
 * 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)

Parâmetros

Parâmetro

Descrição

table_name

O nome da tabela de dados.

index_name

O nome da tabela de índice.

Exemplos

O exemplo a seguir exclua um índice secundário:

$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);