Queries the results of an SQL diagnostics task.
Operation description
Before you call this operation, take note of the following items:
-
If you use an SDK to call the API operations of Database Autonomy Service (DAS), you must set the region ID to cn-shanghai.
-
You cannot call this operation to query the diagnostic result of the automatic SQL optimization feature.
-
This operation is applicable to the following database engines:
RDS MySQL
RDS PostgreSQL
RDS SQL Server
PolarDB for MySQL
PolarDB for PostgreSQL (Compatible with Oracle)
ApsaraDB for MongoDB
If your instance is an ApsaraDB RDS for PostgreSQL instance, make sure that the minor engine version of your instance is 20220130 or later. For more information about how to check and update the minor engine version of an ApsaraDB RDS for PostgreSQL instance, see Update the minor engine version of an ApsaraDB RDS for PostgreSQL instance.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
hdm:GetRequestDiagnosisResult |
get |
*All Resource
|
None | None |
Request parameters
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Message |
string |
The returned message. Note
If the request was successful, Successful is returned. If the request failed, an error message such as an error code is returned. |
Successful |
| RequestId |
string |
The request ID. |
800FBAF5-A539-5B97-A09E-C63AB2F7**** |
| Data |
object |
The returned data. |
|
| messageId |
string |
The unique ID of the diagnostics task. |
61820b594664275c4429**** |
| uuid |
string |
The unique ID of the diagnostics instance. |
hdm_51fe9bc19ec413f4d530431af87a**** |
| accountId |
string |
The user ID. |
2093**** |
| sqlId |
string |
The SQL template ID. |
0c95dae3afef77be06572612df9b**** |
| engine |
string |
The database engine. Valid values:
|
MySQL |
| dbSchema |
string |
The name of the database. |
das |
| param |
string |
The additional information. |
{"":""} |
| state |
integer |
The state of the diagnostics task. Valid values:
|
2 |
| result |
string |
The result of the SQL diagnostics task. The result includes the following information:
|
{ "endTime":1636354256000, "errorCode":"0001", "errorMessage":"TFX成功", "estimateCost":{ "cpu":1.7878745150389268, "io":9.948402604746128, "rows":8.889372575194633 }, "improvement":12933.97, "indexAdvices":[ { "columns":[ "work_no" ], "ddlAddIndex":"ALTER TABLE `test`.`work_order` ADD INDEX `idx_workno` (`work_no`)", "indexName":"idx_workno", "schemaName":"test", "tableName":"work_order", "unique":false } ], "ip":"****.mysql.rds.aliyuncs.com", "messageId":"6188c8cb2f1365b16aee****", "port":3306, "sqlTag":"{\"PRED_EQUAL\":\"Y\",\"CNT_QB\":\"1\",\"CNT_TB\":\"1\"}", "startTime":1636354252000, "success":true, "support":true, "tuningAdvices":[ ] } |
| gmtCreate |
string |
The time when the SQL diagnostics task was created. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. |
1633071840000 |
| gmtModified |
string |
The time when the SQL diagnostics task was modified. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. |
1633071850000 |
| Code |
string |
The HTTP status code returned. |
200 |
| Success |
string |
Indicates whether the request was successful. Valid values:
|
true |
Examples
Success response
JSON format
{
"Message": "Successful",
"RequestId": "800FBAF5-A539-5B97-A09E-C63AB2F7****",
"Data": {
"messageId": "61820b594664275c4429****",
"uuid": "hdm_51fe9bc19ec413f4d530431af87a****",
"accountId": "2093****",
"sqlId": "0c95dae3afef77be06572612df9b****",
"engine": "MySQL",
"dbSchema": "das",
"param": "{\"\":\"\"}",
"state": 2,
"result": "{ \"endTime\":1636354256000, \"errorCode\":\"0001\", \"errorMessage\":\"TFX成功\", \"estimateCost\":{ \"cpu\":1.7878745150389268, \"io\":9.948402604746128, \"rows\":8.889372575194633 }, \"improvement\":12933.97, \"indexAdvices\":[ { \"columns\":[ \"work_no\" ], \"ddlAddIndex\":\"ALTER TABLE `test`.`work_order` ADD INDEX `idx_workno` (`work_no`)\", \"indexName\":\"idx_workno\", \"schemaName\":\"test\", \"tableName\":\"work_order\", \"unique\":false } ], \"ip\":\"****.mysql.rds.aliyuncs.com\", \"messageId\":\"6188c8cb2f1365b16aee****\", \"port\":3306, \"sqlTag\":\"{\\\"PRED_EQUAL\\\":\\\"Y\\\",\\\"CNT_QB\\\":\\\"1\\\",\\\"CNT_TB\\\":\\\"1\\\"}\", \"startTime\":1636354252000, \"success\":true, \"support\":true, \"tuningAdvices\":[ ] }",
"gmtCreate": "1633071840000",
"gmtModified": "1633071850000"
},
"Code": "200",
"Success": "true"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParams | The request parameters are invalid. | |
| 403 | NoPermission | You are not authorized to do this action. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.