获取慢SQL表中的索引
更新时间:2023-08-22
接口说明
获取慢SQL表中的索引
请求结构
Plain Text
1POST /v{version}/instance/{instanceId}/smartdba/slowsql/table/index HTTP/1.1
2HOST: rds.bj.baidubce.com
3Content-Type: application/json
4Authorization: authorization string
5{
6 "sqlId":"sqlId",
7 "schema":"schema",
8 "table":"table",
9 "index":"index"
10}
请求头域
除公共头域外,无其它特殊头域。
请求参数
参数名称 |
类型 |
是否必选 |
参数位置 |
描述 |
---|---|---|---|---|
version | String | 是 | URL参数 | API 版本号 |
instanceId | String | 是 | URL参数 | 实例ID |
sqlId | String | 是 | RequestBody参数 | SQL标识ID |
schema | String | 是 | RequestBody参数 | 指定数据库 |
table | String | 是 | RequestBody参数 | 指定表 |
index | String | 否 | RequestBody参数 | 索引名称 |
返回头域
除公共头域,无其它特殊头域。
返回参数
参数名称 |
类型 |
描述 |
---|---|---|
list | List Array | 列表 |
Array字段数据结构说明
参数名称 |
类型 |
描述 |
---|---|---|
cardinality | Long | 对索引中唯一值数量的估计 |
collation | String | 列在索引中的排序方式。这可以具有值A(升序)、D(降序)或NULL(未排序) |
column | String | 列的名称 |
comment | String | 创建索引时为具有comment属性的索引提供的任何注释 |
index | String | 索引的名称。如果索引是主键,则名称始终为PRIMARY |
nonUnique | Integer | 如果索引不能包含重复项,则为0;如果可以,则为1 |
nullable | String | 列可能包含NULL值,包含为YES;如果不包含为'' |
schema | String | 数据库名称 |
sequence | Long | 索引中的列序列号,从1开始 |
table | String | 表名 |
type | Long | 使用的索引方法(BTREE、FULLTEXT、HASH、RTREE) |
请求示例
Plain Text
1POST /v1/instance/rds-xXE6pdR1/smartdba/slowsql/table/index HTTP/1.1
2HOST: rds.bj.baidubce.com
3Content-Type: application/json
4Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2017-11-21T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de
5{
6 "sqlId":"e9fa9802-0d0e-41b4-b3ba-6496466b6cad",
7 "schema":"db1",
8 "table":"test"
9}
返回示例
Plain Text
1{
2 "list": [
3 {
4 "schema": "db1",
5 "table": "tb1",
6 "collation": "A",
7 "column": "id",
8 "comment": "",
9 "nullable": "",
10 "type": "BTREE",
11 "cardinality": 3,
12 "index": "PRIMARY",
13 "nonUnique": 0,
14 "sequence": "1"
15 }
16 ]
17}