You can execute the show index statement to query the index information about tables.

Note For more information about the show index statement, see Query the index information about a table.

Prerequisites

Parameters

Parameter Description
query The SQL statement. Configure the parameter based on the required feature.

Examples

The following code provides an example on how to execute the SHOW INDEX IN `tableName`; statement to query index information about the table named tableName:

$request = array(
    'query' => 'SHOW INDEX IN `tableName`;',
);
$response = $this->otsClient->sqlQuery ($request);
$sqlRows = $response['sql_rows'];
print json_encode($sqlRows, JSON_PRETTY_PRINT);