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
- An OTSClient instance is initialized. For more information, see Initialization.
- A mapping table is created. For more information, see Create mapping tables.
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);