Obtaining Diagnosis Results
Function
This API is used to obtain SQL diagnosis results.
URI
GET /v3/{project_id}/connections/{connection_id}/tuning/{message_id}/show-tuning-result
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
message_id |
Yes |
String |
Diagnosis information ID. |
project_id |
Yes |
String |
Project ID. To obtain this value, see Obtaining a Project ID. |
connection_id |
Yes |
String |
Connection ID. |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
User token. |
X-Language |
No |
String |
Language. |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
tune_result |
AdviceResult object |
Diagnosis result. |
Parameter |
Type |
Description |
---|---|---|
message_id |
String |
Diagnosis information ID. |
status_code |
String |
Status code. |
error_code |
String |
Error code. |
error_message |
String |
Error message. |
index_advice |
Array of IndexAdviceInfo objects |
Suggestions on indexes. |
tuning_advice |
Array of strings |
Diagnosis suggestions. |
formatted_sql |
String |
Formatted SQL statement. |
original_sql |
String |
Original SQL statement. |
explain |
Array of Explain objects |
Execution plan. |
tb_pos_infos |
Array of TbPosInfo objects |
Table location information. |
feedback_infos |
FeedbackInfo object |
Feedback information. |
Parameter |
Type |
Description |
---|---|---|
schema_name |
String |
Schema name. |
table_name |
String |
Table name. |
index_name |
String |
Index name. |
columns |
Array of strings |
Column. |
unique |
Boolean |
Unique or not. |
track_id |
String |
Tracking ID. |
quality |
Object |
Quality. |
ddl_add_index |
String |
Index to be added for DDL. |
Parameter |
Type |
Description |
---|---|---|
id |
Integer |
Type of the SELECT clause. |
select_type |
String |
Type of the SELECT clause. |
table |
String |
Table JOIN sequence selected by the SQL optimizer. |
type |
String |
Access type of the row in the table, ordered from the best type to the worst (null>system>const>eq_ref>ref>range>index>all). |
possible_keys |
String |
Index that helps find the required row. |
key |
String |
Index actually used by SQL Optimizer to minimize query costs. |
key_len |
String |
Length (bytes) of the index in the key column. |
ref |
String |
Column or constant for querying data using the index in the key column. |
rows |
Long |
Length (bytes) of the index in the key column. |
filtered |
Double |
Percentage of remaining values after data is scanned at the engine layer and filtered based on the additional WHERE condition. |
extra |
String |
Additional information about SQL parsing.
|
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. Minimum length: 8 Maximum length: 36 |
error_msg |
String |
Error message. Minimum length: 2 Maximum length: 512 |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. Minimum length: 8 Maximum length: 36 |
error_msg |
String |
Error message. Minimum length: 2 Maximum length: 512 |
Example Requests
None
Example Responses
{ "tune_result": { "message_id": "6507f5070cf2476b18473d9b", "status_code": "0000", "error_message": "Success", "formatted_sql": "SELECT *\nFROM test_tb", "original_sql": "select * from test_tb", "tuning_advice": [ "The outermost SELECT statement does not have a WHERE condition specified, which could result in more rows being returned than anticipated." ], "explain": [{ "id": 1, "select_type": "SIMPLE", "type": "ALL", "rows": 100512, "filtered": 100 }], "tb_pos_infos": [{ "origin_name": "test_tb", "name": "test_tb", "start": 14, "end": 21 }], "feedback_infos": {} } }
Status Code
Status Code |
Description |
---|---|
200 |
Success. |
400 |
Bad request. |
500 |
Internal server error. |
Error Code
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot