Mengkueri saran optimasi SQL, yang mencakup dua jenis: saran pembuatan indeks dan saran pengikatan rencana eksekusi.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
oceanbase:DescribeSQLTuningAdvices |
get |
*全部资源
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| InstanceId |
string |
Yes |
ID Kluster. |
obsdf43**** |
| TenantId |
string |
Yes |
ID Penyewa. |
tsdc2s2**** |
| DbName |
string |
Yes |
Nama database. |
testdb |
| SqlId |
string |
Yes |
ID SQL. |
123456 |
| StartTime |
string |
Yes |
Pengatur waktu mulai. |
2023-04-12T04:38:38Z |
| EndTime |
string |
Yes |
Pengatur waktu selesai. |
2023-04-12T05:38:38Z |
| AcceptLanguage |
string |
No |
Bahasa yang didukung. Nilai valid:
|
zh-CN |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
Parameter tanggapan. |
||
| RequestId |
string |
ID Permintaan. |
473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E |
| Data |
array<object> |
Daftar informasi rencana eksekusi SQL. |
|
|
array<object> |
Informasi rencana eksekusi SQL. |
||
| Type |
string |
Jenis optimasi. |
PLAN_BINDING/INDEX_CREATION |
| ColumnNames |
string |
Pesanan kolom indeks. |
c1;c2;c3 |
| LocalityType |
string |
Jenis indeks. |
Local/Global |
| Columns |
array<object> |
Daftar kolom indeks. |
|
|
object |
Informasi kolom indeks. |
||
| ColumnName |
string |
The name of the column. |
xxxx |
| Ndv |
number |
The NDV of the column. |
100 |
| MinValue |
string |
The minimum value of the column. |
1 |
| MaxValue |
string |
The maximum value of the column. |
100 |
| DbName |
string |
Nama database. |
test_db |
| Table |
string |
Nama tabel. |
test_table |
| Plan |
object |
Rencana eksekusi. |
|
| Executions |
integer |
The total number of executions within the specified period of time. |
2062 |
| AvgCpuTime |
number |
The average CPU time within the specified period of time, in milliseconds. |
100.36 |
| PlanHash |
string |
The unique identifier of the execution plan in the diagnostic system. |
-86290582****886880 |
| TimeoutPercentage |
number |
The percentage of executions with a timeout error. |
0 |
| AvgConcurrencyWaitTime |
number |
The average amount of time spent on a Concurrency wait event within the specified period of time, in milliseconds. |
0 |
| FirstLoadTimeUs |
integer |
The time when the execution plan was loaded for the first time. |
1672367130576163 |
| AvgDiskWrites |
number |
The average number of physical writes within the specified period of time. |
0 |
| AvgUserIoWaitTime |
number |
The average amount of time spent on a UserIo wait event within the specified period of time, in milliseconds. |
0 |
| PlanSize |
integer |
The size of the execution plan. |
49216 |
| ServerSn |
string |
The ID of the node. |
i-bp1*****sw64dhb***** |
| OutlineData |
string |
The outline_data field of the execution plan. |
xxxxx |
| PlanType |
string |
The type of the execution plan. Valid values: LOCAL, REMOTE, and DIST. |
LOCAL |
| ObDbId |
integer |
The ID of the database. |
1108307720799259 |
| HitPercentage |
number |
The hit rate. |
66.8 |
| AvgBufferGets |
number |
The average number of cache reads within the specified period of time. |
0 |
| ExecPs |
number |
The average number of executions per second within the specified period of time. |
1.45 |
| DelayedLargeQueryPercentage |
number |
The percentage of delayed long-running queries. |
0 |
| TableScan |
boolean |
Indicates whether full table scan is performed. |
false |
| LargeQueryPercentage |
number |
The percentage of completed long-running queries. |
0 |
| SchemaVersion |
integer |
The version of the schema. |
1672367130529680 |
| PlanId |
integer |
The ID of the execution plan. |
818 |
| FirstLoadTime |
string |
The time when the execution plan was loaded for the first time. |
2022-12-30T02:25:30.576Z |
| AvgRowProcessed |
number |
The average wait time of row processing within the specified period of time, in milliseconds. |
1 |
| MergedVersion |
integer |
The version of the major compaction. |
3 |
| HitDiagnosis |
boolean |
Indicates whether the diagnosis is hit. |
false |
| Uid |
string |
The unique identifier of the execution plan. |
AAAAAAAAAAEAAAAAAAADMgAF8QJQwIUj |
| AvgApplicationWaitTime |
number |
The average amount of time spent on an Application wait event within the specified period of time, in milliseconds. |
0 |
| CollectTimeUs |
integer |
The period of time during which data is collected. |
1672358400000000 |
| AvgElapsedTime |
number |
The average interval wait time within the specified period of time, in milliseconds. |
713.62 |
| ObServerId |
integer |
The ID of the server. |
1 |
| OutlineId |
integer |
The ID of the outline. |
1 |
| AvgDiskReads |
number |
The average number of physical reads within the specified period of time. |
0 |
Contoh
Respons sukses
JSONformat
{
"RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E",
"Data": [
{
"Type": "PLAN_BINDING/INDEX_CREATION",
"ColumnNames": "c1;c2;c3",
"LocalityType": "Local/Global",
"Columns": [
{
"ColumnName": "xxxx",
"Ndv": 100,
"MinValue": "1",
"MaxValue": "100"
}
],
"DbName": "test_db",
"Table": "test_table",
"Plan": {
"Executions": 2062,
"AvgCpuTime": 100.36,
"PlanHash": "-86290582****886880",
"TimeoutPercentage": 0,
"AvgConcurrencyWaitTime": 0,
"FirstLoadTimeUs": 1672367130576163,
"AvgDiskWrites": 0,
"AvgUserIoWaitTime": 0,
"PlanSize": 49216,
"ServerSn": "i-bp1*****sw64dhb*****",
"OutlineData": "xxxxx",
"PlanType": "LOCAL",
"ObDbId": 1108307720799259,
"HitPercentage": 66.8,
"AvgBufferGets": 0,
"ExecPs": 1.45,
"DelayedLargeQueryPercentage": 0,
"TableScan": false,
"LargeQueryPercentage": 0,
"SchemaVersion": 1672367130529680,
"PlanId": 818,
"FirstLoadTime": "2022-12-30T02:25:30.576Z",
"AvgRowProcessed": 1,
"MergedVersion": 3,
"HitDiagnosis": false,
"Uid": "AAAAAAAAAAEAAAAAAAADMgAF8QJQwIUj",
"AvgApplicationWaitTime": 0,
"CollectTimeUs": 1672358400000000,
"AvgElapsedTime": 713.62,
"ObServerId": 1,
"OutlineId": 1,
"AvgDiskReads": 0
}
}
]
}
Kode kesalahan
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.