Use Tablestore SDK for PHP para eliminar un índice secundario global o local sin afectar la tabla de datos ni su información.
Precauciones
Un índice secundario eliminado no se puede recuperar. Para volver a usarlo, cree un índice secundario nuevo.
Operación de 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 |
Descripción |
|
table_name |
Nombre de la tabla de datos. |
|
index_name |
Nombre de la tabla de índices. |
Ejemplos
A continuación se muestra un ejemplo que elimina un índice secundario:
$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);