Mengambil rencana eksekusi untuk pernyataan SQL.
Deskripsi operasi
-
This operation supports only ApsaraDB RDS for MySQL and PolarDB for MySQL instances.
-
When using the Alibaba Cloud or DAS SDK, use the latest version.
-
When calling the DAS service with the SDK, set the region to cn-shanghai.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
hdm:DescribeQueryExplain |
get |
*全部资源
|
None | None |
Sintaks permintaan
POST HTTP/1.1
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
ID instans. |
rm-2ze8g2am97624**** |
| NodeId |
string |
No |
ID node. Catatan
Untuk instans PolarDB Basis Data Relasional Cloud-Native for MySQL, jika Anda menentukan ID node, sistem akan mengkueri rencana eksekusi pada node tersebut. Jika tidak, sistem akan mengkueri rencana eksekusi pada node sekunder. Untuk instans ApsaraDB RDS for MySQL ketersediaan tinggi, jika Anda menentukan ID instans, sistem akan mengkueri rencana eksekusi pada node tersebut. Jika tidak, sistem akan mengkueri rencana eksekusi pada node sekunder. |
pi-bp1v203xzzh0a**** |
| Sql |
string |
Yes |
Pernyataan SQL yang ingin Anda dapatkan rencana eksekusinya. |
select * from test where name = 'mockUser' |
| DbName |
string |
No |
Nama database. |
dbtest01 |
| Schema |
string |
No |
Informasi skema. Parameter ini merupakan parameter cadangan. |
无 |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
Response schema |
||
| Code |
string |
The status code returned. A value of 200 indicates success. |
200 |
| Message |
string |
The response message. Catatan
If the request succeeds, this parameter returns Successful. If the request fails, this parameter returns error details such as an error code. |
Successful |
| RequestId |
string |
The ID of the request. |
B6D17591-B48B-4D31-9CD6-9B9796B2**** |
| Success |
string |
Indicates whether the request succeeded:
|
true |
| Data |
array<object> |
List of execution plans. |
|
|
object |
The returned data. |
||
| Id |
string |
The ID of the query. |
1 |
| SelectType |
string |
The type of the query. |
SIMPLE |
| Table |
string |
The name of the table. |
test |
| Type |
string |
The join type. |
eq_ref |
| PossibleKeys |
string |
The indexes that might be used. |
test_idx |
| Key |
string |
The index actually used in the execution plan. |
PRIMARY |
| KeyLen |
string |
The length of the index actually used. |
3 |
| Ref |
string |
The column used by the index. |
test_column |
| Rows |
string |
The number of rows to scan. |
1000 |
| Extra |
string |
Additional information. |
无 |
| QueryPlan |
string |
A reserved field for the PostgreSQL engine. |
无 |
| TableList |
array |
A reserved field for the PostgreSQL engine. |
|
|
string |
A reserved field for the PostgreSQL engine. |
无 |
|
| IndexList |
array |
A reserved field for the PostgreSQL engine. |
|
|
string |
A reserved field for the PostgreSQL engine. |
无 |
|
| LogicalPlanList |
array |
A reserved field for the PolarDB X engine. |
|
|
string |
A reserved field for the PolarDB X engine. |
无 |
|
| StmtText |
string |
A reserved field for the SQL Server engine. |
无 |
| StmtId |
string |
A reserved field for the SQL Server engine. |
无 |
| NodeId |
string |
A reserved field for the SQL Server engine. |
无 |
| Parent |
string |
A reserved field for the SQL Server engine. |
无 |
| PhysicalOp |
string |
A reserved field for the SQL Server engine. |
无 |
| LogicalOp |
string |
A reserved field for the SQL Server engine. |
无 |
| Argument |
string |
A reserved field for the SQL Server engine. |
无 |
| DefinedValues |
string |
A reserved field for the SQL Server engine. |
无 |
| EstimateRows |
string |
A reserved field for the SQL Server engine. |
无 |
| EstimateIO |
string |
A reserved field for the SQL Server engine. |
无 |
| EstimateCPU |
string |
A reserved field for the SQL Server engine. |
无 |
| AvgRowSize |
string |
A reserved field for the SQL Server engine. |
无 |
| TotalSubtreeCost |
string |
A reserved field for the SQL Server engine. |
无 |
| OutputList |
string |
A reserved field for the SQL Server engine. |
无 |
| Warnings |
string |
A reserved field for the SQL Server engine. |
无 |
| Parallel |
string |
A reserved field for the SQL Server engine. |
无 |
| EstimateExecutions |
string |
A reserved field for the SQL Server engine. |
无 |
Contoh
Respons sukses
JSONformat
{
"Code": "200",
"Message": "Successful",
"RequestId": "B6D17591-B48B-4D31-9CD6-9B9796B2****",
"Success": "true",
"Data": [
{
"Id": "1",
"SelectType": "SIMPLE",
"Table": "test",
"Type": "eq_ref",
"PossibleKeys": "test_idx",
"Key": "PRIMARY",
"KeyLen": "3",
"Ref": "test_column",
"Rows": "1000",
"Extra": "无",
"QueryPlan": "无",
"TableList": [
"无"
],
"IndexList": [
"无"
],
"LogicalPlanList": [
"无"
],
"StmtText": "无",
"StmtId": "无",
"NodeId": "无",
"Parent": "无",
"PhysicalOp": "无",
"LogicalOp": "无",
"Argument": "无",
"DefinedValues": "无",
"EstimateRows": "无",
"EstimateIO": "无",
"EstimateCPU": "无",
"AvgRowSize": "无",
"TotalSubtreeCost": "无",
"OutputList": "无",
"Warnings": "无",
"Parallel": "无",
"EstimateExecutions": "无"
}
]
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParams | The request parameters are invalid. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.