Mengambil detail saran pengoptimalan tinjauan SQL. Operasi ini berlaku untuk tiket perubahan data dan tiket SQLReview.
Deskripsi operasi
Untuk informasi selengkapnya tentang fitur tinjauan SQL, lihat SQL Review.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dms:GetSQLReviewOptimizeDetail |
get |
*全部资源
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| SQLReviewQueryKey |
string |
Yes |
Kunci kueri detail saran pengoptimalan tinjauan SQL. Anda dapat memanggil operasi ListSQLReviewOriginSQL untuk memperoleh nilai parameter ini. |
a57e54ec5433475ea3082d882fdb**** |
| Tid |
integer |
No |
ID penyewa. Anda dapat memanggil operasi GetUserActiveTenant atau ListUserTenants untuk memperoleh nilai parameter ini. |
1 |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
ID permintaan. |
0C1CB646-1DE4-4AD0-B4A4-7D47DD52E931 |
| ErrorCode |
string |
Kode kesalahan. |
UnknownError |
| ErrorMessage |
string |
Paket kesalahan. |
UnknownError |
| Success |
boolean |
Apakah permintaan berhasil. |
true |
| OptimizeDetail |
object |
Detail tinjauan. |
|
| QueryKey |
string |
Kunci kueri detail saran pengoptimalan tinjauan SQL. |
a57e54ec5433475ea3082d882fdb**** |
| InstanceId |
integer |
ID instans tempat database berada. |
123321 |
| DbId |
integer |
ID database. |
111222 |
| SqlType |
string |
Tipe SQL, seperti DELETE, UPDATE, dan ALTER_TABLE. |
UPDATE |
| QualityResult |
object |
Kualitas SQL. |
|
| ErrorMessage |
string |
The error message returned. |
syntax error |
| Results |
array<object> |
The review results based on rules. |
|
|
array<object> |
|||
| RuleName |
string |
The name of the rule. For more information, see SQL review optimization. |
SELECT_SUGGEST_ASSIGN_WHERE |
| Feedback |
string |
The optimization suggestion for the SQL statement. Valid values:
|
MUST_IMPROVE |
| Comments |
string |
The comment that is specified when you create the SQL review rule. For more information, see SQL review optimization. |
xxx业务规定:查询必须带where条件 |
| Messages |
array |
The review results. |
|
|
string |
audit information. |
xxx表不存在 |
|
| Scripts |
array<object> |
The SQL script for data changes. |
|
|
object |
|||
| OpType |
string |
The purpose of the SQL script. The value is set to AddIndex. |
AddIndex |
| Content |
string |
The content of the SQL script. |
alter table xxx add index idx_xx(yyy); |
| TableName |
string |
The name of the table. |
xxx |
| RuleType |
string |
The type of the SQL review rule. Valid values:
|
REVIEW |
| OccurError |
boolean |
Indicates whether an error occurs. Valid values:
|
false |
Contoh
Respons sukses
JSONformat
{
"RequestId": "0C1CB646-1DE4-4AD0-B4A4-7D47DD52E931",
"ErrorCode": "UnknownError",
"ErrorMessage": "UnknownError",
"Success": true,
"OptimizeDetail": {
"QueryKey": "a57e54ec5433475ea3082d882fdb****",
"InstanceId": 123321,
"DbId": 111222,
"SqlType": "UPDATE",
"QualityResult": {
"ErrorMessage": "syntax error",
"Results": [
{
"RuleName": "SELECT_SUGGEST_ASSIGN_WHERE",
"Feedback": "MUST_IMPROVE",
"Comments": "xxx业务规定:查询必须带where条件",
"Messages": [
"xxx表不存在"
],
"Scripts": [
{
"OpType": "AddIndex",
"Content": "alter table xxx add index idx_xx(yyy);",
"TableName": "xxx"
}
],
"RuleType": "REVIEW"
}
],
"OccurError": false
}
}
}
Kode kesalahan
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.