From fe1c1a99d174bc1ebc7a632ac48972e39b20cde8 Mon Sep 17 00:00:00 2001 From: crazycs520 Date: Tue, 24 Nov 2020 17:28:49 +0800 Subject: [PATCH 01/31] add more time field for slow query detail page Signed-off-by: crazycs520 --- pkg/apiserver/slowquery/queries.go | 46 +++++++++++-------- .../SlowQuery/pages/Detail/DetailTabTime.tsx | 28 +++++++++++ ui/lib/apps/SlowQuery/translations/en.yaml | 13 +++++- ui/lib/apps/SlowQuery/translations/zh.yaml | 12 ++++- 4 files changed, 76 insertions(+), 23 deletions(-) diff --git a/pkg/apiserver/slowquery/queries.go b/pkg/apiserver/slowquery/queries.go index f200e80431..5a05784a01 100644 --- a/pkg/apiserver/slowquery/queries.go +++ b/pkg/apiserver/slowquery/queries.go @@ -37,11 +37,17 @@ type SlowQuery struct { ConnectionID string `gorm:"column:Conn_ID" json:"connection_id"` Success int `gorm:"column:Succ" json:"success"` - Timestamp float64 `gorm:"column:timestamp" proj:"(UNIX_TIMESTAMP(Time) + 0E0)" json:"timestamp"` // finish time - QueryTime float64 `gorm:"column:Query_time" json:"query_time"` // latency - ParseTime float64 `gorm:"column:Parse_time" json:"parse_time"` - CompileTime float64 `gorm:"column:Compile_time" json:"compile_time"` - ProcessTime float64 `gorm:"column:Process_time" json:"process_time"` + Timestamp float64 `gorm:"column:timestamp" proj:"(UNIX_TIMESTAMP(Time) + 0E0)" json:"timestamp"` // finish time + ExecRetryTime float64 `gorm:"column:Exec_retry_time" json:"exec_retry_time"` // latency + QueryTime float64 `gorm:"column:Query_time" json:"query_time"` // latency + ParseTime float64 `gorm:"column:Parse_time" json:"parse_time"` + CompileTime float64 `gorm:"column:Compile_time" json:"compile_time"` + RewriteTime float64 `gorm:"column:Rewrite_time" json:"rewrite_time"` + PreprocSubqueriesTime float64 `gorm:"column:Preproc_subqueries_time" json:"preproc_subqueries_time"` + OptimizeTime float64 `gorm:"column:Optimize_time" json:"optimize_time"` + CopTime float64 `gorm:"column:Cop_time" json:"cop_time"` + LockKeysTime float64 `gorm:"column:LockKeys_time" json:"lock_keys_time"` + WriteRespTime float64 `gorm:"column:Write_sql_response_total" json:"write_sql_response_total"` MemoryMax int `gorm:"column:Mem_max" json:"memory_max"` DiskMax int `gorm:"column:Disk_max" json:"disk_max"` @@ -63,20 +69,22 @@ type SlowQuery struct { Host string `gorm:"column:Host" json:"host"` // Time - WaitTime float64 `gorm:"column:Wait_time" json:"wait_time"` - BackoffTime float64 `gorm:"column:Backoff_time" json:"backoff_time"` - GetCommitTSTime float64 `gorm:"column:Get_commit_ts_time" json:"get_commit_ts_time"` - LocalLatchWaitTime float64 `gorm:"column:Local_latch_wait_time" json:"local_latch_wait_time"` - ResolveLockTime float64 `gorm:"column:Resolve_lock_time" json:"resolve_lock_time"` - PrewriteTime float64 `gorm:"column:Prewrite_time" json:"prewrite_time"` - CommitTime float64 `gorm:"column:Commit_time" json:"commit_time"` - CommitBackoffTime float64 `gorm:"column:Commit_backoff_time" json:"commit_backoff_time"` - CopProcAvg float64 `gorm:"column:Cop_proc_avg" json:"cop_proc_avg"` - CopProcP90 float64 `gorm:"column:Cop_proc_p90" json:"cop_proc_p90"` - CopProcMax float64 `gorm:"column:Cop_proc_max" json:"cop_proc_max"` - CopWaitAvg float64 `gorm:"column:Cop_wait_avg" json:"cop_wait_avg"` - CopWaitP90 float64 `gorm:"column:Cop_wait_p90" json:"cop_wait_p90"` - CopWaitMax float64 `gorm:"column:Cop_wait_max" json:"cop_wait_max"` + ProcessTime float64 `gorm:"column:Process_time" json:"process_time"` + WaitTime float64 `gorm:"column:Wait_time" json:"wait_time"` + BackoffTime float64 `gorm:"column:Backoff_time" json:"backoff_time"` + GetCommitTSTime float64 `gorm:"column:Get_commit_ts_time" json:"get_commit_ts_time"` + LocalLatchWaitTime float64 `gorm:"column:Local_latch_wait_time" json:"local_latch_wait_time"` + ResolveLockTime float64 `gorm:"column:Resolve_lock_time" json:"resolve_lock_time"` + PrewriteTime float64 `gorm:"column:Prewrite_time" json:"prewrite_time"` + WaitPreWriteBinlogTime float64 `gorm:"column:Wait_prewrite_binlog_time" json:"wait_prewrite_binlog_time"` + CommitTime float64 `gorm:"column:Commit_time" json:"commit_time"` + CommitBackoffTime float64 `gorm:"column:Commit_backoff_time" json:"commit_backoff_time"` + CopProcAvg float64 `gorm:"column:Cop_proc_avg" json:"cop_proc_avg"` + CopProcP90 float64 `gorm:"column:Cop_proc_p90" json:"cop_proc_p90"` + CopProcMax float64 `gorm:"column:Cop_proc_max" json:"cop_proc_max"` + CopWaitAvg float64 `gorm:"column:Cop_wait_avg" json:"cop_wait_avg"` + CopWaitP90 float64 `gorm:"column:Cop_wait_p90" json:"cop_wait_p90"` + CopWaitMax float64 `gorm:"column:Cop_wait_max" json:"cop_wait_max"` // Transaction WriteKeys int `gorm:"column:Write_keys" json:"write_keys"` diff --git a/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx b/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx index 222ccabd18..d1000d9ddd 100644 --- a/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx +++ b/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx @@ -20,6 +20,26 @@ export default function TabBasic({ data }: ITabTimeProps) { key: 'compile_time', value: data.compile_time! * 10e8, }, + { + key: 'rewrite_time', + value: data.rewrite_time! * 10e8, + }, + { + key: 'preproc_subqueries_time', + value: data.preproc_subqueries_time! * 10e8, + }, + { + key: 'optimize_time', + value: data.optimize_time! * 10e8, + }, + { + key: 'cop_time', + value: data.cop_time! * 10e8, + }, + { + key: 'lock_keys_time', + value: data.lock_keys_time! * 10e8, + }, { key: 'wait_time', value: data.wait_time! * 10e8, @@ -48,6 +68,10 @@ export default function TabBasic({ data }: ITabTimeProps) { key: 'prewrite_time', value: data.prewrite_time! * 10e8, }, + { + key: 'wait_prewrite_binlog_time', + value: data.wait_prewrite_binlog_time! * 10e8, + }, { key: 'commit_time', value: data.commit_time! * 10e8, @@ -56,6 +80,10 @@ export default function TabBasic({ data }: ITabTimeProps) { key: 'commit_backoff_time', value: data.commit_backoff_time! * 10e8, }, + { + key: 'write_sql_response_total', + value: data.write_sql_response_total! * 10e8, + }, { key: 'query_time2', keyDisplay: ( diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index f59f30746e..b66089561c 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -36,8 +36,14 @@ slow_query: parse_time: Parse Time parse_time_tooltip: Time consumed when parsing the query - compile_time: Compile Time - compile_time_tooltip: Time consumed when optimizing the query + compile_time: Generate plan Time + compile_time_tooltip: Time consumed when generating plan of the query + rewrite_time: Rewrite plan Time + preproc_subqueries_time: Preprocess subquery Time + optimize_time: Optimize plan Time + cop_time: Cop request Time + lock_keys_time: Lock keys Time + lock_keys_time_tooltip: Time consumed when locking keys in pessimistic transaction wait_time: Coprocessor Wait Time process_time: Coprocessor Process Time backoff_time: Backoff Retry Time @@ -46,10 +52,13 @@ slow_query: local_latch_wait_time: Local Latch Wait Time resolve_lock_time: Resolve Lock Time prewrite_time: Prewrite Time + wait_prewrite_binlog_time: Wait binlog prewrite Time commit_time: Commit Time commit_backoff_time: Commit Backoff Time query_time2: Query Time query_time2_tooltip: The execution time of a query (due to the parallel execution, it may be significantly smaller than the above time) + write_sql_response_total: Send response Time + write_sql_response_total_tooltip: Time consumed when sending response to the client. request_count: Request Count process_keys: Process Keys diff --git a/ui/lib/apps/SlowQuery/translations/zh.yaml b/ui/lib/apps/SlowQuery/translations/zh.yaml index f1521f82dd..c342e49082 100644 --- a/ui/lib/apps/SlowQuery/translations/zh.yaml +++ b/ui/lib/apps/SlowQuery/translations/zh.yaml @@ -36,8 +36,13 @@ slow_query: parse_time: 解析耗时 parse_time_tooltip: 解析该 SQL 查询的耗时 - compile_time: 优化耗时 - compile_time_tooltip: 优化该 SQL 查询的耗时 + compile_time: 生成执行计划耗时 + compile_time_tooltip: 生成该 SQL 的执行计划的耗时 + rewrite_time: 重写执行计划耗时 + preproc_subqueries_time: 子查询预处理耗时 + optimize_time: 优化执行计划耗时 + cop_time: cop 请求耗时 + lock_keys_time: 上锁耗时 wait_time: Coprocessor 累计等待耗时 process_time: Coprocessor 累计执行耗时 process_time_tooltip: Coprocessor 累计执行耗时 @@ -49,10 +54,13 @@ slow_query: resolve_lock_time: Resolve Lock 耗时 resolve_lock_time_tooltip: 事务在 TiKV 与其他事务产生了锁冲突并处理锁冲突的耗时 prewrite_time: Prewrite 阶段耗时 + wait_prewrite_binlog_time: 等 binlog 预写入耗时 commit_time: Commit 阶段耗时 commit_backoff_time: Commit 重试等待耗时 query_time2: SQL 执行时间 query_time2_tooltip: 由于存在并行执行,因此 SQL 执行时间可能远小于上述各项时间 + write_sql_response_total: 发送结果耗时 + write_sql_response_total_tooltip: 发送 SQL 结果给客户端的耗时 request_count: Coprocessor 请求数 process_keys: 可见版本数 From 1729986ced77c0b3545b42ad522ab1b890bb9857 Mon Sep 17 00:00:00 2001 From: crazycs520 Date: Tue, 24 Nov 2020 17:43:09 +0800 Subject: [PATCH 02/31] add exec retry time Signed-off-by: crazycs520 --- ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx | 4 ++++ ui/lib/apps/SlowQuery/translations/en.yaml | 4 +++- ui/lib/apps/SlowQuery/translations/zh.yaml | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx b/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx index d1000d9ddd..bebeded722 100644 --- a/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx +++ b/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx @@ -84,6 +84,10 @@ export default function TabBasic({ data }: ITabTimeProps) { key: 'write_sql_response_total', value: data.write_sql_response_total! * 10e8, }, + { + key: 'exec_retry_time', + value: data.exec_retry_time! * 10e8, + }, { key: 'query_time2', keyDisplay: ( diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index b66089561c..4da1fd52bc 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -58,7 +58,9 @@ slow_query: query_time2: Query Time query_time2_tooltip: The execution time of a query (due to the parallel execution, it may be significantly smaller than the above time) write_sql_response_total: Send response Time - write_sql_response_total_tooltip: Time consumed when sending response to the client. + write_sql_response_total_tooltip: Time consumed when sending response to the client + exec_retry_time: Retry execution Time + exec_retry_time_tooltip: Time consumed of retry execution request_count: Request Count process_keys: Process Keys diff --git a/ui/lib/apps/SlowQuery/translations/zh.yaml b/ui/lib/apps/SlowQuery/translations/zh.yaml index c342e49082..e9f1b9f06a 100644 --- a/ui/lib/apps/SlowQuery/translations/zh.yaml +++ b/ui/lib/apps/SlowQuery/translations/zh.yaml @@ -61,6 +61,8 @@ slow_query: query_time2_tooltip: 由于存在并行执行,因此 SQL 执行时间可能远小于上述各项时间 write_sql_response_total: 发送结果耗时 write_sql_response_total_tooltip: 发送 SQL 结果给客户端的耗时 + exec_retry_time: 执行重试耗时 + exec_retry_time_tooltip: 执行失败时时执行重试耗时 request_count: Coprocessor 请求数 process_keys: 可见版本数 From 043467ddc1f9a24fd9380a660491096fd07591eb Mon Sep 17 00:00:00 2001 From: crazycs520 Date: Tue, 24 Nov 2020 17:49:34 +0800 Subject: [PATCH 03/31] refine Signed-off-by: crazycs520 --- pkg/apiserver/slowquery/queries.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/apiserver/slowquery/queries.go b/pkg/apiserver/slowquery/queries.go index 5a05784a01..c6db839acb 100644 --- a/pkg/apiserver/slowquery/queries.go +++ b/pkg/apiserver/slowquery/queries.go @@ -38,7 +38,6 @@ type SlowQuery struct { Success int `gorm:"column:Succ" json:"success"` Timestamp float64 `gorm:"column:timestamp" proj:"(UNIX_TIMESTAMP(Time) + 0E0)" json:"timestamp"` // finish time - ExecRetryTime float64 `gorm:"column:Exec_retry_time" json:"exec_retry_time"` // latency QueryTime float64 `gorm:"column:Query_time" json:"query_time"` // latency ParseTime float64 `gorm:"column:Parse_time" json:"parse_time"` CompileTime float64 `gorm:"column:Compile_time" json:"compile_time"` @@ -48,6 +47,7 @@ type SlowQuery struct { CopTime float64 `gorm:"column:Cop_time" json:"cop_time"` LockKeysTime float64 `gorm:"column:LockKeys_time" json:"lock_keys_time"` WriteRespTime float64 `gorm:"column:Write_sql_response_total" json:"write_sql_response_total"` + ExecRetryTime float64 `gorm:"column:Exec_retry_time" json:"exec_retry_time"` MemoryMax int `gorm:"column:Mem_max" json:"memory_max"` DiskMax int `gorm:"column:Disk_max" json:"disk_max"` From 4ce951ff45796331c7e1314ad1113e2cb8f16fe1 Mon Sep 17 00:00:00 2001 From: crazycs520 Date: Wed, 25 Nov 2020 11:34:23 +0800 Subject: [PATCH 04/31] add wait ts Signed-off-by: crazycs520 --- pkg/apiserver/slowquery/queries.go | 1 + ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx | 4 ++++ ui/lib/apps/SlowQuery/translations/en.yaml | 2 ++ ui/lib/apps/SlowQuery/translations/zh.yaml | 2 ++ 4 files changed, 9 insertions(+) diff --git a/pkg/apiserver/slowquery/queries.go b/pkg/apiserver/slowquery/queries.go index c6db839acb..6b356cd4ed 100644 --- a/pkg/apiserver/slowquery/queries.go +++ b/pkg/apiserver/slowquery/queries.go @@ -44,6 +44,7 @@ type SlowQuery struct { RewriteTime float64 `gorm:"column:Rewrite_time" json:"rewrite_time"` PreprocSubqueriesTime float64 `gorm:"column:Preproc_subqueries_time" json:"preproc_subqueries_time"` OptimizeTime float64 `gorm:"column:Optimize_time" json:"optimize_time"` + WaitTSTime float64 `gorm:"column:Wait_TS" json:"wait_ts"` CopTime float64 `gorm:"column:Cop_time" json:"cop_time"` LockKeysTime float64 `gorm:"column:LockKeys_time" json:"lock_keys_time"` WriteRespTime float64 `gorm:"column:Write_sql_response_total" json:"write_sql_response_total"` diff --git a/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx b/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx index bebeded722..e937add46d 100644 --- a/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx +++ b/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx @@ -32,6 +32,10 @@ export default function TabBasic({ data }: ITabTimeProps) { key: 'optimize_time', value: data.optimize_time! * 10e8, }, + { + key: 'wait_ts', + value: data.wait_ts! * 10e8, + }, { key: 'cop_time', value: data.cop_time! * 10e8, diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index 4da1fd52bc..8d12e9a3ca 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -61,6 +61,8 @@ slow_query: write_sql_response_total_tooltip: Time consumed when sending response to the client exec_retry_time: Retry execution Time exec_retry_time_tooltip: Time consumed of retry execution + wait_ts: Wait Txn StartTS Time + wait_ts_tooltip: Time consumed of waiting transaction start ts request_count: Request Count process_keys: Process Keys diff --git a/ui/lib/apps/SlowQuery/translations/zh.yaml b/ui/lib/apps/SlowQuery/translations/zh.yaml index e9f1b9f06a..55da77f4d9 100644 --- a/ui/lib/apps/SlowQuery/translations/zh.yaml +++ b/ui/lib/apps/SlowQuery/translations/zh.yaml @@ -63,6 +63,8 @@ slow_query: write_sql_response_total_tooltip: 发送 SQL 结果给客户端的耗时 exec_retry_time: 执行重试耗时 exec_retry_time_tooltip: 执行失败时时执行重试耗时 + wait_ts: 等待事务开始时间戳耗时 + wait_ts_tooltip: 等待获取事务开始的时间戳的耗时 request_count: Coprocessor 请求数 process_keys: 可见版本数 From 6d022e0bfc447dd46f6f8a8e10849ecd4ec67bcb Mon Sep 17 00:00:00 2001 From: crazycs520 Date: Wed, 25 Nov 2020 18:12:04 +0800 Subject: [PATCH 05/31] refine display Signed-off-by: crazycs520 --- .../SlowQuery/pages/Detail/DetailTabTime.tsx | 58 +++++++++---------- ui/lib/apps/SlowQuery/translations/en.yaml | 44 +++++++------- ui/lib/apps/SlowQuery/translations/zh.yaml | 42 +++++++------- 3 files changed, 72 insertions(+), 72 deletions(-) diff --git a/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx b/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx index e937add46d..46e8e690ba 100644 --- a/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx +++ b/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx @@ -12,6 +12,23 @@ export interface ITabTimeProps { export default function TabBasic({ data }: ITabTimeProps) { const { t } = useTranslation() const items = [ + { + key: 'write_sql_response_total', + value: data.write_sql_response_total! * 10e8, + }, + { + key: 'exec_retry_time', + value: data.exec_retry_time! * 10e8, + }, + { + key: 'query_time2', + keyDisplay: ( + + {t('slow_query.fields.query_time2')} + + ), + value: data.query_time! * 10e8, + }, { key: 'parse_time', value: data.parse_time! * 10e8, @@ -40,10 +57,6 @@ export default function TabBasic({ data }: ITabTimeProps) { key: 'cop_time', value: data.cop_time! * 10e8, }, - { - key: 'lock_keys_time', - value: data.lock_keys_time! * 10e8, - }, { key: 'wait_time', value: data.wait_time! * 10e8, @@ -53,20 +66,16 @@ export default function TabBasic({ data }: ITabTimeProps) { value: data.process_time! * 10e8, }, { - key: 'backoff_time', - value: data.backoff_time! * 10e8, - }, - { - key: 'get_commit_ts_time', - value: data.get_commit_ts_time! * 10e8, + key: 'lock_keys_time', + value: data.lock_keys_time! * 10e8, }, { key: 'local_latch_wait_time', value: data.local_latch_wait_time! * 10e8, }, { - key: 'resolve_lock_time', - value: data.resolve_lock_time! * 10e8, + key: 'backoff_time', + value: data.backoff_time! * 10e8, }, { key: 'prewrite_time', @@ -77,29 +86,20 @@ export default function TabBasic({ data }: ITabTimeProps) { value: data.wait_prewrite_binlog_time! * 10e8, }, { - key: 'commit_time', - value: data.commit_time! * 10e8, - }, - { - key: 'commit_backoff_time', - value: data.commit_backoff_time! * 10e8, + key: 'get_commit_ts_time', + value: data.get_commit_ts_time! * 10e8, }, { - key: 'write_sql_response_total', - value: data.write_sql_response_total! * 10e8, + key: 'commit_time', + value: data.commit_time! * 10e8, }, { - key: 'exec_retry_time', - value: data.exec_retry_time! * 10e8, + key: 'resolve_lock_time', + value: data.resolve_lock_time! * 10e8, }, { - key: 'query_time2', - keyDisplay: ( - - {t('slow_query.fields.query_time2')} - - ), - value: data.query_time! * 10e8, + key: 'commit_backoff_time', + value: data.commit_backoff_time! * 10e8, }, ] const columns = timeValueColumns('slow_query.fields.', items) diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index 8d12e9a3ca..b490540137 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -34,35 +34,35 @@ slow_query: db: Execution Database db_tooltip: The database used to execute the query - parse_time: Parse Time + query_time2: Query Time + query_time2_tooltip: The execution time of a query (due to the parallel execution, it may be significantly smaller than the above time) + parse_time:   Parse Time parse_time_tooltip: Time consumed when parsing the query - compile_time: Generate plan Time + compile_time:   Generate plan Time compile_time_tooltip: Time consumed when generating plan of the query - rewrite_time: Rewrite plan Time - preproc_subqueries_time: Preprocess subquery Time - optimize_time: Optimize plan Time - cop_time: Cop request Time - lock_keys_time: Lock keys Time - lock_keys_time_tooltip: Time consumed when locking keys in pessimistic transaction - wait_time: Coprocessor Wait Time - process_time: Coprocessor Process Time - backoff_time: Backoff Retry Time + rewrite_time:     Rewrite plan Time + preproc_subqueries_time:       Preprocess subquery Time + optimize_time:     Optimize plan Time + wait_ts:   Wait Txn StartTS Time + wait_ts_tooltip: Time consumed of waiting transaction start ts + cop_time:   Coprocessor request Time + wait_time:     Coprocessor Wait Time + process_time:     Coprocessor Process Time + backoff_time:   Backoff Retry Time backoff_time_tooltip: The waiting time before retry when a query encounters errors that require a retry - get_commit_ts_time: Get Commit Ts Time - local_latch_wait_time: Local Latch Wait Time - resolve_lock_time: Resolve Lock Time - prewrite_time: Prewrite Time - wait_prewrite_binlog_time: Wait binlog prewrite Time - commit_time: Commit Time - commit_backoff_time: Commit Backoff Time - query_time2: Query Time - query_time2_tooltip: The execution time of a query (due to the parallel execution, it may be significantly smaller than the above time) + lock_keys_time:   Lock keys Time + lock_keys_time_tooltip: Time consumed when locking keys in pessimistic transaction + get_commit_ts_time:   Get Commit Ts Time + local_latch_wait_time:   Local Latch Wait Time + resolve_lock_time:   Resolve Lock Time + prewrite_time:   Prewrite Time + wait_prewrite_binlog_time:   Wait binlog prewrite Time + commit_time:   Commit Time + commit_backoff_time:   Commit Backoff Time write_sql_response_total: Send response Time write_sql_response_total_tooltip: Time consumed when sending response to the client exec_retry_time: Retry execution Time exec_retry_time_tooltip: Time consumed of retry execution - wait_ts: Wait Txn StartTS Time - wait_ts_tooltip: Time consumed of waiting transaction start ts request_count: Request Count process_keys: Process Keys diff --git a/ui/lib/apps/SlowQuery/translations/zh.yaml b/ui/lib/apps/SlowQuery/translations/zh.yaml index 55da77f4d9..3c6801c8cf 100644 --- a/ui/lib/apps/SlowQuery/translations/zh.yaml +++ b/ui/lib/apps/SlowQuery/translations/zh.yaml @@ -34,37 +34,37 @@ slow_query: db: 执行数据库 db_tooltip: 执行该 SQL 查询时使用的数据库名称 - parse_time: 解析耗时 + query_time2: SQL 执行时间 + query_time2_tooltip: 由于存在并行执行,因此 SQL 执行时间可能远小于上述各项时间 + parse_time:   解析耗时 parse_time_tooltip: 解析该 SQL 查询的耗时 - compile_time: 生成执行计划耗时 + compile_time:   生成执行计划耗时 compile_time_tooltip: 生成该 SQL 的执行计划的耗时 - rewrite_time: 重写执行计划耗时 - preproc_subqueries_time: 子查询预处理耗时 - optimize_time: 优化执行计划耗时 - cop_time: cop 请求耗时 - lock_keys_time: 上锁耗时 - wait_time: Coprocessor 累计等待耗时 - process_time: Coprocessor 累计执行耗时 + rewrite_time:     重写执行计划耗时 + preproc_subqueries_time:       子查询预处理耗时 + optimize_time:     优化执行计划耗时 + wait_ts:   等待事务开始时间戳耗时 + wait_ts_tooltip: 等待获取事务开始的时间戳的耗时 + cop_time:   Coprocessor 请求耗时 + wait_time:     Coprocessor 累计等待耗时 + process_time:     Coprocessor 累计执行耗时 process_time_tooltip: Coprocessor 累计执行耗时 - backoff_time: 累计重试等待耗时 - get_commit_ts_time: 取 Commit Ts 耗时 + lock_keys_time:   上锁耗时 + backoff_time:   累计重试等待耗时 + get_commit_ts_time:   取 Commit Ts 耗时 get_commit_ts_time_tooltip: 从 PD 取递交时间戳(事务号)步骤的耗时 - local_latch_wait_time: Local Latch Wait 耗时 + local_latch_wait_time:   Local Latch Wait 耗时 local_latch_wait_time_tooltip: 事务在 TiDB 本地与其他事务产生了锁冲突并等待的耗时 - resolve_lock_time: Resolve Lock 耗时 + resolve_lock_time:   Resolve Lock 耗时 resolve_lock_time_tooltip: 事务在 TiKV 与其他事务产生了锁冲突并处理锁冲突的耗时 - prewrite_time: Prewrite 阶段耗时 - wait_prewrite_binlog_time: 等 binlog 预写入耗时 - commit_time: Commit 阶段耗时 - commit_backoff_time: Commit 重试等待耗时 - query_time2: SQL 执行时间 - query_time2_tooltip: 由于存在并行执行,因此 SQL 执行时间可能远小于上述各项时间 + prewrite_time:   Prewrite 阶段耗时 + wait_prewrite_binlog_time:   等 binlog 预写入耗时 + commit_time:   Commit 阶段耗时 + commit_backoff_time:   Commit 重试等待耗时 write_sql_response_total: 发送结果耗时 write_sql_response_total_tooltip: 发送 SQL 结果给客户端的耗时 exec_retry_time: 执行重试耗时 exec_retry_time_tooltip: 执行失败时时执行重试耗时 - wait_ts: 等待事务开始时间戳耗时 - wait_ts_tooltip: 等待获取事务开始的时间戳的耗时 request_count: Coprocessor 请求数 process_keys: 可见版本数 From 9c424c748d1ff64e0d0aabb362de02bdb7326dc3 Mon Sep 17 00:00:00 2001 From: crazycs520 Date: Wed, 25 Nov 2020 20:26:22 +0800 Subject: [PATCH 06/31] add more comment Signed-off-by: crazycs520 --- .../SlowQuery/pages/Detail/DetailTabTime.tsx | 8 +++---- ui/lib/apps/SlowQuery/translations/en.yaml | 15 ++++++++++-- ui/lib/apps/SlowQuery/translations/zh.yaml | 24 +++++++++++++------ 3 files changed, 34 insertions(+), 13 deletions(-) diff --git a/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx b/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx index 46e8e690ba..a8df5c212c 100644 --- a/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx +++ b/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx @@ -69,10 +69,6 @@ export default function TabBasic({ data }: ITabTimeProps) { key: 'lock_keys_time', value: data.lock_keys_time! * 10e8, }, - { - key: 'local_latch_wait_time', - value: data.local_latch_wait_time! * 10e8, - }, { key: 'backoff_time', value: data.backoff_time! * 10e8, @@ -81,6 +77,10 @@ export default function TabBasic({ data }: ITabTimeProps) { key: 'prewrite_time', value: data.prewrite_time! * 10e8, }, + { + key: 'local_latch_wait_time', + value: data.local_latch_wait_time! * 10e8, + }, { key: 'wait_prewrite_binlog_time', value: data.wait_prewrite_binlog_time! * 10e8, diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index b490540137..3ae2a4a95e 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -35,34 +35,45 @@ slow_query: db_tooltip: The database used to execute the query query_time2: Query Time - query_time2_tooltip: The execution time of a query (due to the parallel execution, it may be significantly smaller than the above time) + query_time2_tooltip: The execution time of a query (due to the parallel execution, it may be significantly smaller than the following time) parse_time:   Parse Time parse_time_tooltip: Time consumed when parsing the query compile_time:   Generate plan Time compile_time_tooltip: Time consumed when generating plan of the query rewrite_time:     Rewrite plan Time preproc_subqueries_time:       Preprocess subquery Time + preproc_subqueries_time_tooltip: The time consumed of pre-process the subquery during the rewrite plan phase optimize_time:     Optimize plan Time wait_ts:   Wait Txn StartTS Time wait_ts_tooltip: Time consumed of waiting transaction start ts cop_time:   Coprocessor request Time + cop_time_tooltip: Time consumed of TiDB sending cop request wait_time:     Coprocessor Wait Time + wait_time_tooltip: The total waiting time of cop request in TiKV. Because the Coprocessor of TiKV runs a limited number of threads, cop requests might queue up when all threads of Coprocessor are working process_time:     Coprocessor Process Time + process_time_tooltip: The total processing time of a SQL statement in TiKV. Because data is sent to TiKV concurrently, this value might exceed the query time backoff_time:   Backoff Retry Time backoff_time_tooltip: The waiting time before retry when a query encounters errors that require a retry lock_keys_time:   Lock keys Time lock_keys_time_tooltip: Time consumed when locking keys in pessimistic transaction get_commit_ts_time:   Get Commit Ts Time + get_commit_ts_time_tooltip: The time spent on getting commit_ts during the second phase (commit) of the two-phase transaction commit local_latch_wait_time:   Local Latch Wait Time + local_latch_wait_time_tooltip: The time that TiDB spends on waiting for the lock before the second phase (commit) of the two-phase transaction commit resolve_lock_time:   Resolve Lock Time + resolve_lock_time_tooltip: The time that TiDB resolves locks when prewrite encounters locks. prewrite_time:   Prewrite Time + prewrite_time_tooltip: The duration of the first phase (prewrite) of the two-phase transaction commit wait_prewrite_binlog_time:   Wait binlog prewrite Time + wait_prewrite_binlog_time_tooltip: The duration of waiting prewrite binlog finish commit_time:   Commit Time + commit_time_tooltip: The duration of the second phase (commit) of the two-phase transaction commit commit_backoff_time:   Commit Backoff Time + commit_backoff_time_tooltip: The waiting time when the two-phase transaction commit encounters errors write_sql_response_total: Send response Time write_sql_response_total_tooltip: Time consumed when sending response to the client exec_retry_time: Retry execution Time - exec_retry_time_tooltip: Time consumed of retry execution + exec_retry_time_tooltip: Time consumed of retry execution that cause by locks or errors. request_count: Request Count process_keys: Process Keys diff --git a/ui/lib/apps/SlowQuery/translations/zh.yaml b/ui/lib/apps/SlowQuery/translations/zh.yaml index 3c6801c8cf..fddfcbbb75 100644 --- a/ui/lib/apps/SlowQuery/translations/zh.yaml +++ b/ui/lib/apps/SlowQuery/translations/zh.yaml @@ -35,36 +35,46 @@ slow_query: db_tooltip: 执行该 SQL 查询时使用的数据库名称 query_time2: SQL 执行时间 - query_time2_tooltip: 由于存在并行执行,因此 SQL 执行时间可能远小于上述各项时间 + query_time2_tooltip: 由于存在并行执行,因此 SQL 执行时间可能远小于以下各项时间 parse_time:   解析耗时 parse_time_tooltip: 解析该 SQL 查询的耗时 compile_time:   生成执行计划耗时 compile_time_tooltip: 生成该 SQL 的执行计划的耗时 rewrite_time:     重写执行计划耗时 + rewrite_time_tooltip: 重写执行计划的耗时,例如常量折叠等 preproc_subqueries_time:       子查询预处理耗时 optimize_time:     优化执行计划耗时 + optimize_time_tooltip: 优化器寻找执行计划的耗时,包括规则优化和物理优化的耗时 wait_ts:   等待事务开始时间戳耗时 - wait_ts_tooltip: 等待获取事务开始的时间戳的耗时 + wait_ts_tooltip: 从 PD 取事务开始时间戳步骤的耗时 cop_time:   Coprocessor 请求耗时 + cop_time_tooltip: TiDB 发送 cop 请求的耗时 wait_time:     Coprocessor 累计等待耗时 + wait_time_tooltip: 在 TiKV Coprocessor 的等待时间之和,因为 TiKV 的 Coprocessor 线程数是有限的,当所有的 Coprocessor 线程都在工作的时候,cop 请求会排队; process_time:     Coprocessor 累计执行耗时 - process_time_tooltip: Coprocessor 累计执行耗时 + process_time_tooltip: 在 TiKV Coprocessor 的处理时间之和,因为请求会并行的发到 TiKV 执行,这个值可能会超过 SQL 执行时间 lock_keys_time:   上锁耗时 + lock_keys_time_tooltip: 悲观事务中对相关行数据进行上锁的耗时 backoff_time:   累计重试等待耗时 + backoff_time_tooltip: 执行过程中遇到锁或者错误后的等待耗时 get_commit_ts_time:   取 Commit Ts 耗时 - get_commit_ts_time_tooltip: 从 PD 取递交时间戳(事务号)步骤的耗时 + get_commit_ts_time_tooltip: 从 PD 取提交时间戳(事务号)步骤的耗时 local_latch_wait_time:   Local Latch Wait 耗时 local_latch_wait_time_tooltip: 事务在 TiDB 本地与其他事务产生了锁冲突并等待的耗时 resolve_lock_time:   Resolve Lock 耗时 - resolve_lock_time_tooltip: 事务在 TiKV 与其他事务产生了锁冲突并处理锁冲突的耗时 + resolve_lock_time_tooltip: 事务在提交过程中与其他事务产生了锁冲突并处理锁冲突的耗时 prewrite_time:   Prewrite 阶段耗时 - wait_prewrite_binlog_time:   等 binlog 预写入耗时 + prewrite_time_tooltip: 事务两阶段提交中第一阶段(prewrite 阶段)的耗时 + wait_prewrite_binlog_time:   等 binlog Prewrite 耗时 + wait_prewrite_binlog_time_tooltip: 等待 binlog prewrite 完成的耗时 commit_time:   Commit 阶段耗时 + commit_time_tooltip: 事务两阶段提交中第二阶段(commit 阶段)的耗时 commit_backoff_time:   Commit 重试等待耗时 + commit_backoff_time_tooltip: 事务两阶段提交过程中遇到锁或者错误后的等待耗时 write_sql_response_total: 发送结果耗时 write_sql_response_total_tooltip: 发送 SQL 结果给客户端的耗时 exec_retry_time: 执行重试耗时 - exec_retry_time_tooltip: 执行失败时时执行重试耗时 + exec_retry_time_tooltip: 由于锁冲突或者某些错误导致执行失败的执行耗时 request_count: Coprocessor 请求数 process_keys: 可见版本数 From c43ecdf47c72bf1e14b561c83fd3510d0bcba84a Mon Sep 17 00:00:00 2001 From: crazycs Date: Thu, 26 Nov 2020 14:21:39 +0800 Subject: [PATCH 07/31] Update ui/lib/apps/SlowQuery/translations/en.yaml Co-authored-by: Wenxuan --- ui/lib/apps/SlowQuery/translations/en.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index 3ae2a4a95e..24c353fffc 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -46,7 +46,7 @@ slow_query: optimize_time:     Optimize plan Time wait_ts:   Wait Txn StartTS Time wait_ts_tooltip: Time consumed of waiting transaction start ts - cop_time:   Coprocessor request Time + cop_time:   Coprocessor Request Time cop_time_tooltip: Time consumed of TiDB sending cop request wait_time:     Coprocessor Wait Time wait_time_tooltip: The total waiting time of cop request in TiKV. Because the Coprocessor of TiKV runs a limited number of threads, cop requests might queue up when all threads of Coprocessor are working From a3aad95fc6b32d83304e2c190d644165ccd3597a Mon Sep 17 00:00:00 2001 From: crazycs Date: Thu, 26 Nov 2020 14:21:49 +0800 Subject: [PATCH 08/31] Update ui/lib/apps/SlowQuery/translations/en.yaml Co-authored-by: Wenxuan --- ui/lib/apps/SlowQuery/translations/en.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index 24c353fffc..f5c8221c1c 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -54,7 +54,7 @@ slow_query: process_time_tooltip: The total processing time of a SQL statement in TiKV. Because data is sent to TiKV concurrently, this value might exceed the query time backoff_time:   Backoff Retry Time backoff_time_tooltip: The waiting time before retry when a query encounters errors that require a retry - lock_keys_time:   Lock keys Time + lock_keys_time:   Lock Keys Time lock_keys_time_tooltip: Time consumed when locking keys in pessimistic transaction get_commit_ts_time:   Get Commit Ts Time get_commit_ts_time_tooltip: The time spent on getting commit_ts during the second phase (commit) of the two-phase transaction commit From c005bb2367cff3d18a65c15827f9c7485c2b13e7 Mon Sep 17 00:00:00 2001 From: crazycs Date: Thu, 26 Nov 2020 14:21:56 +0800 Subject: [PATCH 09/31] Update ui/lib/apps/SlowQuery/translations/en.yaml Co-authored-by: Wenxuan --- ui/lib/apps/SlowQuery/translations/en.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index f5c8221c1c..93babf6520 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -38,7 +38,7 @@ slow_query: query_time2_tooltip: The execution time of a query (due to the parallel execution, it may be significantly smaller than the following time) parse_time:   Parse Time parse_time_tooltip: Time consumed when parsing the query - compile_time:   Generate plan Time + compile_time:   Generate Plan Time compile_time_tooltip: Time consumed when generating plan of the query rewrite_time:     Rewrite plan Time preproc_subqueries_time:       Preprocess subquery Time From fea6b6b6ce4d7e6f8a99790984df2c7ac1470394 Mon Sep 17 00:00:00 2001 From: crazycs Date: Thu, 26 Nov 2020 14:22:06 +0800 Subject: [PATCH 10/31] Update ui/lib/apps/SlowQuery/translations/en.yaml Co-authored-by: Wenxuan --- ui/lib/apps/SlowQuery/translations/en.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index 93babf6520..3596c413a5 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -40,7 +40,7 @@ slow_query: parse_time_tooltip: Time consumed when parsing the query compile_time:   Generate Plan Time compile_time_tooltip: Time consumed when generating plan of the query - rewrite_time:     Rewrite plan Time + rewrite_time:     Rewrite Plan Time preproc_subqueries_time:       Preprocess subquery Time preproc_subqueries_time_tooltip: The time consumed of pre-process the subquery during the rewrite plan phase optimize_time:     Optimize plan Time From 10de0989557aa99ebac6c3d31ef987bfe5733e5e Mon Sep 17 00:00:00 2001 From: crazycs Date: Thu, 26 Nov 2020 14:26:17 +0800 Subject: [PATCH 11/31] Update ui/lib/apps/SlowQuery/translations/en.yaml Co-authored-by: Wenxuan --- ui/lib/apps/SlowQuery/translations/en.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index 3596c413a5..c53a865d5c 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -41,7 +41,7 @@ slow_query: compile_time:   Generate Plan Time compile_time_tooltip: Time consumed when generating plan of the query rewrite_time:     Rewrite Plan Time - preproc_subqueries_time:       Preprocess subquery Time + preproc_subqueries_time:       Preprocess Sub-Query Time preproc_subqueries_time_tooltip: The time consumed of pre-process the subquery during the rewrite plan phase optimize_time:     Optimize plan Time wait_ts:   Wait Txn StartTS Time From cf9daa9f12e7e225bf4d801b6184bf11bb051b2a Mon Sep 17 00:00:00 2001 From: crazycs Date: Thu, 26 Nov 2020 14:26:38 +0800 Subject: [PATCH 12/31] Update ui/lib/apps/SlowQuery/translations/en.yaml Co-authored-by: Wenxuan --- ui/lib/apps/SlowQuery/translations/en.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index c53a865d5c..405dd259c5 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -71,7 +71,7 @@ slow_query: commit_backoff_time:   Commit Backoff Time commit_backoff_time_tooltip: The waiting time when the two-phase transaction commit encounters errors write_sql_response_total: Send response Time - write_sql_response_total_tooltip: Time consumed when sending response to the client + write_sql_response_total_tooltip: Time consumed when sending response to the SQL client exec_retry_time: Retry execution Time exec_retry_time_tooltip: Time consumed of retry execution that cause by locks or errors. From 5607611ec313c7e46f4c76a945a8152faa60fd3e Mon Sep 17 00:00:00 2001 From: crazycs Date: Thu, 26 Nov 2020 14:26:54 +0800 Subject: [PATCH 13/31] Update ui/lib/apps/SlowQuery/translations/en.yaml Co-authored-by: Wenxuan --- ui/lib/apps/SlowQuery/translations/en.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index 405dd259c5..82b94bc7aa 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -73,7 +73,7 @@ slow_query: write_sql_response_total: Send response Time write_sql_response_total_tooltip: Time consumed when sending response to the SQL client exec_retry_time: Retry execution Time - exec_retry_time_tooltip: Time consumed of retry execution that cause by locks or errors. + exec_retry_time_tooltip: Time consumed when retrying the SQL statement execution caused by locks or errors. request_count: Request Count process_keys: Process Keys From 46b54a20bdd80e86481aeb05879e0b37714a6667 Mon Sep 17 00:00:00 2001 From: crazycs Date: Thu, 26 Nov 2020 14:30:57 +0800 Subject: [PATCH 14/31] Update ui/lib/apps/SlowQuery/translations/en.yaml Co-authored-by: Wenxuan --- ui/lib/apps/SlowQuery/translations/en.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index 82b94bc7aa..614b4a9c23 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -69,7 +69,7 @@ slow_query: commit_time:   Commit Time commit_time_tooltip: The duration of the second phase (commit) of the two-phase transaction commit commit_backoff_time:   Commit Backoff Time - commit_backoff_time_tooltip: The waiting time when the two-phase transaction commit encounters errors + commit_backoff_time_tooltip: Total backoff waiting time when 2PC commit encounters errors when transaction commits write_sql_response_total: Send response Time write_sql_response_total_tooltip: Time consumed when sending response to the SQL client exec_retry_time: Retry execution Time From d90c6cfad20461ad8df6f081f8d8ccd47f33960f Mon Sep 17 00:00:00 2001 From: crazycs Date: Thu, 26 Nov 2020 14:31:05 +0800 Subject: [PATCH 15/31] Update ui/lib/apps/SlowQuery/translations/en.yaml Co-authored-by: Wenxuan --- ui/lib/apps/SlowQuery/translations/en.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index 614b4a9c23..1963ea2e10 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -67,7 +67,7 @@ slow_query: wait_prewrite_binlog_time:   Wait binlog prewrite Time wait_prewrite_binlog_time_tooltip: The duration of waiting prewrite binlog finish commit_time:   Commit Time - commit_time_tooltip: The duration of the second phase (commit) of the two-phase transaction commit + commit_time_tooltip: Time consumed in 2PC commit phase when transaction commits commit_backoff_time:   Commit Backoff Time commit_backoff_time_tooltip: Total backoff waiting time when 2PC commit encounters errors when transaction commits write_sql_response_total: Send response Time From 71e6c8fbf98bf27e419eab4aae1ab58fda611afb Mon Sep 17 00:00:00 2001 From: crazycs Date: Thu, 26 Nov 2020 14:32:15 +0800 Subject: [PATCH 16/31] Update ui/lib/apps/SlowQuery/translations/en.yaml --- ui/lib/apps/SlowQuery/translations/en.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index 1963ea2e10..a7b087eebe 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -39,7 +39,6 @@ slow_query: parse_time:   Parse Time parse_time_tooltip: Time consumed when parsing the query compile_time:   Generate Plan Time - compile_time_tooltip: Time consumed when generating plan of the query rewrite_time:     Rewrite Plan Time preproc_subqueries_time:       Preprocess Sub-Query Time preproc_subqueries_time_tooltip: The time consumed of pre-process the subquery during the rewrite plan phase From 5e3d88315d7647031171c20c8bf5c278356bc05e Mon Sep 17 00:00:00 2001 From: crazycs Date: Thu, 26 Nov 2020 14:32:50 +0800 Subject: [PATCH 17/31] Update ui/lib/apps/SlowQuery/translations/en.yaml Co-authored-by: Wenxuan --- ui/lib/apps/SlowQuery/translations/en.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index a7b087eebe..89ea64054e 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -42,7 +42,7 @@ slow_query: rewrite_time:     Rewrite Plan Time preproc_subqueries_time:       Preprocess Sub-Query Time preproc_subqueries_time_tooltip: The time consumed of pre-process the subquery during the rewrite plan phase - optimize_time:     Optimize plan Time + optimize_time:     Optimize Plan Time wait_ts:   Wait Txn StartTS Time wait_ts_tooltip: Time consumed of waiting transaction start ts cop_time:   Coprocessor Request Time From 8f8d00b44a89824dc9312b68beb820b2d00f085b Mon Sep 17 00:00:00 2001 From: crazycs Date: Thu, 26 Nov 2020 14:36:42 +0800 Subject: [PATCH 18/31] Update ui/lib/apps/SlowQuery/translations/en.yaml --- ui/lib/apps/SlowQuery/translations/en.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index 89ea64054e..1839cadbd3 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -48,7 +48,7 @@ slow_query: cop_time:   Coprocessor Request Time cop_time_tooltip: Time consumed of TiDB sending cop request wait_time:     Coprocessor Wait Time - wait_time_tooltip: The total waiting time of cop request in TiKV. Because the Coprocessor of TiKV runs a limited number of threads, cop requests might queue up when all threads of Coprocessor are working + wait_time_tooltip: The total waiting time of cop request in TiKV. process_time:     Coprocessor Process Time process_time_tooltip: The total processing time of a SQL statement in TiKV. Because data is sent to TiKV concurrently, this value might exceed the query time backoff_time:   Backoff Retry Time From dd40265338018e96af714a8e6a0c371e8cf247da Mon Sep 17 00:00:00 2001 From: crazycs Date: Thu, 26 Nov 2020 14:37:00 +0800 Subject: [PATCH 19/31] Update ui/lib/apps/SlowQuery/translations/en.yaml Co-authored-by: Wenxuan --- ui/lib/apps/SlowQuery/translations/en.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index 1839cadbd3..b448bfda1a 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -50,7 +50,7 @@ slow_query: wait_time:     Coprocessor Wait Time wait_time_tooltip: The total waiting time of cop request in TiKV. process_time:     Coprocessor Process Time - process_time_tooltip: The total processing time of a SQL statement in TiKV. Because data is sent to TiKV concurrently, this value might exceed the query time + process_time_tooltip: The total execution time of a SQL statement executed in TiKV. Because TiKV process SQL statement partials concurrently, this value can exceed the query time backoff_time:   Backoff Retry Time backoff_time_tooltip: The waiting time before retry when a query encounters errors that require a retry lock_keys_time:   Lock Keys Time From 26bcd44e61e09164be6765d90eb1f3c0f54d4696 Mon Sep 17 00:00:00 2001 From: crazycs Date: Thu, 26 Nov 2020 14:37:11 +0800 Subject: [PATCH 20/31] Update ui/lib/apps/SlowQuery/translations/en.yaml Co-authored-by: Wenxuan --- ui/lib/apps/SlowQuery/translations/en.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index b448bfda1a..593f7fa160 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -56,7 +56,7 @@ slow_query: lock_keys_time:   Lock Keys Time lock_keys_time_tooltip: Time consumed when locking keys in pessimistic transaction get_commit_ts_time:   Get Commit Ts Time - get_commit_ts_time_tooltip: The time spent on getting commit_ts during the second phase (commit) of the two-phase transaction commit + get_commit_ts_time_tooltip: Time consumed when getting a commit timestamp for 2PC commit phase when transaction commits local_latch_wait_time:   Local Latch Wait Time local_latch_wait_time_tooltip: The time that TiDB spends on waiting for the lock before the second phase (commit) of the two-phase transaction commit resolve_lock_time:   Resolve Lock Time From 6626815d35a10c701757e7f7759b3e955b07266e Mon Sep 17 00:00:00 2001 From: crazycs Date: Thu, 26 Nov 2020 14:37:30 +0800 Subject: [PATCH 21/31] Update ui/lib/apps/SlowQuery/translations/en.yaml Co-authored-by: Wenxuan --- ui/lib/apps/SlowQuery/translations/en.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index 593f7fa160..c77eebc6ef 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -58,7 +58,7 @@ slow_query: get_commit_ts_time:   Get Commit Ts Time get_commit_ts_time_tooltip: Time consumed when getting a commit timestamp for 2PC commit phase when transaction commits local_latch_wait_time:   Local Latch Wait Time - local_latch_wait_time_tooltip: The time that TiDB spends on waiting for the lock before the second phase (commit) of the two-phase transaction commit + local_latch_wait_time_tooltip: Time consumed when TiDB waits for the lock in the current TiDB instance before 2PC commit phase when transaction commits resolve_lock_time:   Resolve Lock Time resolve_lock_time_tooltip: The time that TiDB resolves locks when prewrite encounters locks. prewrite_time:   Prewrite Time From 453c1272e002e0b7515cb7bc16ab748b62e8f395 Mon Sep 17 00:00:00 2001 From: crazycs Date: Thu, 26 Nov 2020 14:37:47 +0800 Subject: [PATCH 22/31] Update ui/lib/apps/SlowQuery/translations/en.yaml Co-authored-by: Wenxuan --- ui/lib/apps/SlowQuery/translations/en.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index c77eebc6ef..054d5d268c 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -60,7 +60,7 @@ slow_query: local_latch_wait_time:   Local Latch Wait Time local_latch_wait_time_tooltip: Time consumed when TiDB waits for the lock in the current TiDB instance before 2PC commit phase when transaction commits resolve_lock_time:   Resolve Lock Time - resolve_lock_time_tooltip: The time that TiDB resolves locks when prewrite encounters locks. + resolve_lock_time_tooltip: Time consumed when TiDB resolves locks from other transactions in 2PC prewrite phase when transaction commits prewrite_time:   Prewrite Time prewrite_time_tooltip: The duration of the first phase (prewrite) of the two-phase transaction commit wait_prewrite_binlog_time:   Wait binlog prewrite Time From 4190910231c0a9f3707b6331a0a001589dba9f99 Mon Sep 17 00:00:00 2001 From: crazycs Date: Thu, 26 Nov 2020 14:38:02 +0800 Subject: [PATCH 23/31] Update ui/lib/apps/SlowQuery/translations/en.yaml Co-authored-by: Wenxuan --- ui/lib/apps/SlowQuery/translations/en.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index 054d5d268c..72bcd39d2b 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -62,7 +62,7 @@ slow_query: resolve_lock_time:   Resolve Lock Time resolve_lock_time_tooltip: Time consumed when TiDB resolves locks from other transactions in 2PC prewrite phase when transaction commits prewrite_time:   Prewrite Time - prewrite_time_tooltip: The duration of the first phase (prewrite) of the two-phase transaction commit + prewrite_time_tooltip: Time consumed in 2PC prewrite phase when transaction commits wait_prewrite_binlog_time:   Wait binlog prewrite Time wait_prewrite_binlog_time_tooltip: The duration of waiting prewrite binlog finish commit_time:   Commit Time From f38822ee4d81fcdfc212b88514561987b10ffc1d Mon Sep 17 00:00:00 2001 From: crazycs Date: Thu, 26 Nov 2020 14:38:09 +0800 Subject: [PATCH 24/31] Update ui/lib/apps/SlowQuery/translations/en.yaml Co-authored-by: Wenxuan --- ui/lib/apps/SlowQuery/translations/en.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index 72bcd39d2b..933419bfe7 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -63,7 +63,7 @@ slow_query: resolve_lock_time_tooltip: Time consumed when TiDB resolves locks from other transactions in 2PC prewrite phase when transaction commits prewrite_time:   Prewrite Time prewrite_time_tooltip: Time consumed in 2PC prewrite phase when transaction commits - wait_prewrite_binlog_time:   Wait binlog prewrite Time + wait_prewrite_binlog_time:   Wait Binlog Prewrite Time wait_prewrite_binlog_time_tooltip: The duration of waiting prewrite binlog finish commit_time:   Commit Time commit_time_tooltip: Time consumed in 2PC commit phase when transaction commits From a4e88e084e8d2d857b3b2465e066041cdbce7f98 Mon Sep 17 00:00:00 2001 From: crazycs Date: Thu, 26 Nov 2020 14:38:17 +0800 Subject: [PATCH 25/31] Update ui/lib/apps/SlowQuery/translations/en.yaml Co-authored-by: Wenxuan --- ui/lib/apps/SlowQuery/translations/en.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index 933419bfe7..8af24b8aea 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -64,7 +64,7 @@ slow_query: prewrite_time:   Prewrite Time prewrite_time_tooltip: Time consumed in 2PC prewrite phase when transaction commits wait_prewrite_binlog_time:   Wait Binlog Prewrite Time - wait_prewrite_binlog_time_tooltip: The duration of waiting prewrite binlog finish + wait_prewrite_binlog_time_tooltip: Time consumed when waiting Binlog prewrite to finish commit_time:   Commit Time commit_time_tooltip: Time consumed in 2PC commit phase when transaction commits commit_backoff_time:   Commit Backoff Time From b08e954f31ded02417a113d2425732a4ecb4f51a Mon Sep 17 00:00:00 2001 From: crazycs Date: Thu, 26 Nov 2020 14:39:29 +0800 Subject: [PATCH 26/31] Update ui/lib/apps/SlowQuery/translations/en.yaml --- ui/lib/apps/SlowQuery/translations/en.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index 8af24b8aea..a4f4926eef 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -44,7 +44,7 @@ slow_query: preproc_subqueries_time_tooltip: The time consumed of pre-process the subquery during the rewrite plan phase optimize_time:     Optimize Plan Time wait_ts:   Wait Txn StartTS Time - wait_ts_tooltip: Time consumed of waiting transaction start ts + wait_ts_tooltip: Time consumed of retrieving transaction start ts cop_time:   Coprocessor Request Time cop_time_tooltip: Time consumed of TiDB sending cop request wait_time:     Coprocessor Wait Time From 388aecc7276f4e45e42a5d5309c4df67b393e860 Mon Sep 17 00:00:00 2001 From: crazycs520 Date: Thu, 26 Nov 2020 14:53:51 +0800 Subject: [PATCH 27/31] refine time model Signed-off-by: crazycs520 --- .../SlowQuery/pages/Detail/DetailTabTime.tsx | 16 ++++++++-------- ui/lib/apps/SlowQuery/translations/en.yaml | 4 ++-- ui/lib/apps/SlowQuery/translations/zh.yaml | 4 ++-- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx b/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx index a8df5c212c..07c68758da 100644 --- a/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx +++ b/ui/lib/apps/SlowQuery/pages/Detail/DetailTabTime.tsx @@ -12,14 +12,6 @@ export interface ITabTimeProps { export default function TabBasic({ data }: ITabTimeProps) { const { t } = useTranslation() const items = [ - { - key: 'write_sql_response_total', - value: data.write_sql_response_total! * 10e8, - }, - { - key: 'exec_retry_time', - value: data.exec_retry_time! * 10e8, - }, { key: 'query_time2', keyDisplay: ( @@ -101,6 +93,14 @@ export default function TabBasic({ data }: ITabTimeProps) { key: 'commit_backoff_time', value: data.commit_backoff_time! * 10e8, }, + { + key: 'exec_retry_time', + value: data.exec_retry_time! * 10e8, + }, + { + key: 'write_sql_response_total', + value: data.write_sql_response_total! * 10e8, + }, ] const columns = timeValueColumns('slow_query.fields.', items) return ( diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index a4f4926eef..2f402a2c23 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -69,9 +69,9 @@ slow_query: commit_time_tooltip: Time consumed in 2PC commit phase when transaction commits commit_backoff_time:   Commit Backoff Time commit_backoff_time_tooltip: Total backoff waiting time when 2PC commit encounters errors when transaction commits - write_sql_response_total: Send response Time + write_sql_response_total:   Send response Time write_sql_response_total_tooltip: Time consumed when sending response to the SQL client - exec_retry_time: Retry execution Time + exec_retry_time:   Retry execution Time exec_retry_time_tooltip: Time consumed when retrying the SQL statement execution caused by locks or errors. request_count: Request Count diff --git a/ui/lib/apps/SlowQuery/translations/zh.yaml b/ui/lib/apps/SlowQuery/translations/zh.yaml index fddfcbbb75..44b055b0db 100644 --- a/ui/lib/apps/SlowQuery/translations/zh.yaml +++ b/ui/lib/apps/SlowQuery/translations/zh.yaml @@ -71,9 +71,9 @@ slow_query: commit_time_tooltip: 事务两阶段提交中第二阶段(commit 阶段)的耗时 commit_backoff_time:   Commit 重试等待耗时 commit_backoff_time_tooltip: 事务两阶段提交过程中遇到锁或者错误后的等待耗时 - write_sql_response_total: 发送结果耗时 + write_sql_response_total:   发送结果耗时 write_sql_response_total_tooltip: 发送 SQL 结果给客户端的耗时 - exec_retry_time: 执行重试耗时 + exec_retry_time:   执行重试耗时 exec_retry_time_tooltip: 由于锁冲突或者某些错误导致执行失败的执行耗时 request_count: Coprocessor 请求数 From f66d54d58f021c0163d7d7242637e01a86c9b9ae Mon Sep 17 00:00:00 2001 From: crazycs520 Date: Thu, 26 Nov 2020 16:11:40 +0800 Subject: [PATCH 28/31] address comment Signed-off-by: crazycs520 --- ui/lib/apps/SlowQuery/translations/en.yaml | 6 +++--- ui/lib/apps/SlowQuery/translations/zh.yaml | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index 2f402a2c23..7d9539e23d 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -43,10 +43,10 @@ slow_query: preproc_subqueries_time:       Preprocess Sub-Query Time preproc_subqueries_time_tooltip: The time consumed of pre-process the subquery during the rewrite plan phase optimize_time:     Optimize Plan Time - wait_ts:   Wait Txn StartTS Time + wait_ts:   Get Txn Start Ts Time wait_ts_tooltip: Time consumed of retrieving transaction start ts - cop_time:   Coprocessor Request Time - cop_time_tooltip: Time consumed of TiDB sending cop request + cop_time:   Coprocessor Executor Time + cop_time_tooltip: Time consumed of TiDB executing cop request wait_time:     Coprocessor Wait Time wait_time_tooltip: The total waiting time of cop request in TiKV. process_time:     Coprocessor Process Time diff --git a/ui/lib/apps/SlowQuery/translations/zh.yaml b/ui/lib/apps/SlowQuery/translations/zh.yaml index 44b055b0db..45c6b20588 100644 --- a/ui/lib/apps/SlowQuery/translations/zh.yaml +++ b/ui/lib/apps/SlowQuery/translations/zh.yaml @@ -45,19 +45,19 @@ slow_query: preproc_subqueries_time:       子查询预处理耗时 optimize_time:     优化执行计划耗时 optimize_time_tooltip: 优化器寻找执行计划的耗时,包括规则优化和物理优化的耗时 - wait_ts:   等待事务开始时间戳耗时 + wait_ts:   取事务 Start Ts 耗时 wait_ts_tooltip: 从 PD 取事务开始时间戳步骤的耗时 - cop_time:   Coprocessor 请求耗时 - cop_time_tooltip: TiDB 发送 cop 请求的耗时 + cop_time:   Coprocessor 执行耗时 + cop_time_tooltip: TiDB 执行 cop 请求的耗时 wait_time:     Coprocessor 累计等待耗时 - wait_time_tooltip: 在 TiKV Coprocessor 的等待时间之和,因为 TiKV 的 Coprocessor 线程数是有限的,当所有的 Coprocessor 线程都在工作的时候,cop 请求会排队; + wait_time_tooltip: 在 TiKV Coprocessor 的等待时间之和 process_time:     Coprocessor 累计执行耗时 process_time_tooltip: 在 TiKV Coprocessor 的处理时间之和,因为请求会并行的发到 TiKV 执行,这个值可能会超过 SQL 执行时间 lock_keys_time:   上锁耗时 lock_keys_time_tooltip: 悲观事务中对相关行数据进行上锁的耗时 backoff_time:   累计重试等待耗时 backoff_time_tooltip: 执行过程中遇到锁或者错误后的等待耗时 - get_commit_ts_time:   取 Commit Ts 耗时 + get_commit_ts_time:   取事务 Commit Ts 耗时 get_commit_ts_time_tooltip: 从 PD 取提交时间戳(事务号)步骤的耗时 local_latch_wait_time:   Local Latch Wait 耗时 local_latch_wait_time_tooltip: 事务在 TiDB 本地与其他事务产生了锁冲突并等待的耗时 From 949f991b651bb1de72f1c26629ed57f00253bd29 Mon Sep 17 00:00:00 2001 From: crazycs520 Date: Thu, 26 Nov 2020 16:13:56 +0800 Subject: [PATCH 29/31] refine comment Signed-off-by: crazycs520 --- ui/lib/apps/SlowQuery/translations/en.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index 7d9539e23d..e4b5dced5a 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -48,7 +48,7 @@ slow_query: cop_time:   Coprocessor Executor Time cop_time_tooltip: Time consumed of TiDB executing cop request wait_time:     Coprocessor Wait Time - wait_time_tooltip: The total waiting time of cop request in TiKV. + wait_time_tooltip: The total waiting time of cop request in TiKV process_time:     Coprocessor Process Time process_time_tooltip: The total execution time of a SQL statement executed in TiKV. Because TiKV process SQL statement partials concurrently, this value can exceed the query time backoff_time:   Backoff Retry Time From cb2decc70c1a3d4ea39b727bb8e5bca7055d699f Mon Sep 17 00:00:00 2001 From: Wenxuan Date: Thu, 26 Nov 2020 17:10:05 +0800 Subject: [PATCH 30/31] Apply suggestions from code review --- ui/lib/apps/SlowQuery/translations/en.yaml | 16 ++++++++-------- ui/lib/apps/SlowQuery/translations/zh.yaml | 14 +++++++------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index e4b5dced5a..a08565ac77 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -35,24 +35,24 @@ slow_query: db_tooltip: The database used to execute the query query_time2: Query Time - query_time2_tooltip: The execution time of a query (due to the parallel execution, it may be significantly smaller than the following time) + query_time2_tooltip: The elapsed wall time when execution the query parse_time:   Parse Time parse_time_tooltip: Time consumed when parsing the query compile_time:   Generate Plan Time rewrite_time:     Rewrite Plan Time preproc_subqueries_time:       Preprocess Sub-Query Time - preproc_subqueries_time_tooltip: The time consumed of pre-process the subquery during the rewrite plan phase + preproc_subqueries_time_tooltip: Time consumed when pre-processing the subquery during the rewrite plan phase optimize_time:     Optimize Plan Time - wait_ts:   Get Txn Start Ts Time - wait_ts_tooltip: Time consumed of retrieving transaction start ts + wait_ts:   Get Start Ts Time + wait_ts_tooltip: Time consumed of retrieving the transaction start timestamp when transaction begins cop_time:   Coprocessor Executor Time - cop_time_tooltip: Time consumed of TiDB executing cop request + cop_time_tooltip: The elapsed wall time when TiDB Coprocessor executor waiting all Coprocessor requests to finish (note: when there are JOIN in SQL statement, multiple TiDB Coprocessor executors may be running in parallel, which may cause this time not being a wall time) wait_time:     Coprocessor Wait Time - wait_time_tooltip: The total waiting time of cop request in TiKV + wait_time_tooltip: The total waiting time of Coprocessor request in TiKV process_time:     Coprocessor Process Time - process_time_tooltip: The total execution time of a SQL statement executed in TiKV. Because TiKV process SQL statement partials concurrently, this value can exceed the query time + process_time_tooltip: The total time of Coprocessor request being executed in TiKV (note: TiKV executes requests in parallel so that this is not a wall time) backoff_time:   Backoff Retry Time - backoff_time_tooltip: The waiting time before retry when a query encounters errors that require a retry + backoff_time_tooltip: The total waiting time before retry when a query encounters errors and requires a retry (note: there may be multiple backoff running in parallel so that this may not be a wall time) lock_keys_time:   Lock Keys Time lock_keys_time_tooltip: Time consumed when locking keys in pessimistic transaction get_commit_ts_time:   Get Commit Ts Time diff --git a/ui/lib/apps/SlowQuery/translations/zh.yaml b/ui/lib/apps/SlowQuery/translations/zh.yaml index 45c6b20588..d5c46b20df 100644 --- a/ui/lib/apps/SlowQuery/translations/zh.yaml +++ b/ui/lib/apps/SlowQuery/translations/zh.yaml @@ -35,7 +35,7 @@ slow_query: db_tooltip: 执行该 SQL 查询时使用的数据库名称 query_time2: SQL 执行时间 - query_time2_tooltip: 由于存在并行执行,因此 SQL 执行时间可能远小于以下各项时间 + query_time2_tooltip: 执行 SQL 耗费的自然时间 parse_time:   解析耗时 parse_time_tooltip: 解析该 SQL 查询的耗时 compile_time:   生成执行计划耗时 @@ -48,15 +48,15 @@ slow_query: wait_ts:   取事务 Start Ts 耗时 wait_ts_tooltip: 从 PD 取事务开始时间戳步骤的耗时 cop_time:   Coprocessor 执行耗时 - cop_time_tooltip: TiDB 执行 cop 请求的耗时 + cop_time_tooltip: TiDB Coprocessor 算子等待所有任务在 TiKV 上并行执行完毕耗费的自然时间(注:当 SQL 语句中包含 JOIN 时,多个 TiDB Coprocessor 算子可能会并行执行,此时不再等同于自然时间) wait_time:     Coprocessor 累计等待耗时 - wait_time_tooltip: 在 TiKV Coprocessor 的等待时间之和 + wait_time_tooltip: TiKV 准备并等待 Coprocessor 任务执行的累计时间 process_time:     Coprocessor 累计执行耗时 - process_time_tooltip: 在 TiKV Coprocessor 的处理时间之和,因为请求会并行的发到 TiKV 执行,这个值可能会超过 SQL 执行时间 + process_time_tooltip: TiKV 执行 Coprocessor 任务的累计处理时间(注:TiKV 会并行处理请求,该时间不是自然流逝时间) lock_keys_time:   上锁耗时 lock_keys_time_tooltip: 悲观事务中对相关行数据进行上锁的耗时 backoff_time:   累计重试等待耗时 - backoff_time_tooltip: 执行过程中遇到锁或者错误后的等待耗时 + backoff_time_tooltip: 执行过程中遇到锁或者错误后的累计等待耗时(注:可能同时存在多个重试等待,因此该时间可能不是自然流逝时间) get_commit_ts_time:   取事务 Commit Ts 耗时 get_commit_ts_time_tooltip: 从 PD 取提交时间戳(事务号)步骤的耗时 local_latch_wait_time:   Local Latch Wait 耗时 @@ -65,8 +65,8 @@ slow_query: resolve_lock_time_tooltip: 事务在提交过程中与其他事务产生了锁冲突并处理锁冲突的耗时 prewrite_time:   Prewrite 阶段耗时 prewrite_time_tooltip: 事务两阶段提交中第一阶段(prewrite 阶段)的耗时 - wait_prewrite_binlog_time:   等 binlog Prewrite 耗时 - wait_prewrite_binlog_time_tooltip: 等待 binlog prewrite 完成的耗时 + wait_prewrite_binlog_time:   Binlog Prewrite 等待耗时 + wait_prewrite_binlog_time_tooltip: 等待 Binlog Prewrite 完成的耗时 commit_time:   Commit 阶段耗时 commit_time_tooltip: 事务两阶段提交中第二阶段(commit 阶段)的耗时 commit_backoff_time:   Commit 重试等待耗时 From cd56b4f050f457328315f128352cb8256ae69164 Mon Sep 17 00:00:00 2001 From: Wenxuan Date: Thu, 26 Nov 2020 17:17:12 +0800 Subject: [PATCH 31/31] Apply suggestions from code review --- ui/lib/apps/SlowQuery/translations/en.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ui/lib/apps/SlowQuery/translations/en.yaml b/ui/lib/apps/SlowQuery/translations/en.yaml index a08565ac77..e6b37792dd 100644 --- a/ui/lib/apps/SlowQuery/translations/en.yaml +++ b/ui/lib/apps/SlowQuery/translations/en.yaml @@ -46,13 +46,13 @@ slow_query: wait_ts:   Get Start Ts Time wait_ts_tooltip: Time consumed of retrieving the transaction start timestamp when transaction begins cop_time:   Coprocessor Executor Time - cop_time_tooltip: The elapsed wall time when TiDB Coprocessor executor waiting all Coprocessor requests to finish (note: when there are JOIN in SQL statement, multiple TiDB Coprocessor executors may be running in parallel, which may cause this time not being a wall time) + cop_time_tooltip: 'The elapsed wall time when TiDB Coprocessor executor waiting all Coprocessor requests to finish (note: when there are JOIN in SQL statement, multiple TiDB Coprocessor executors may be running in parallel, which may cause this time not being a wall time)' wait_time:     Coprocessor Wait Time wait_time_tooltip: The total waiting time of Coprocessor request in TiKV process_time:     Coprocessor Process Time - process_time_tooltip: The total time of Coprocessor request being executed in TiKV (note: TiKV executes requests in parallel so that this is not a wall time) + process_time_tooltip: 'The total time of Coprocessor request being executed in TiKV (note: TiKV executes requests in parallel so that this is not a wall time)' backoff_time:   Backoff Retry Time - backoff_time_tooltip: The total waiting time before retry when a query encounters errors and requires a retry (note: there may be multiple backoff running in parallel so that this may not be a wall time) + backoff_time_tooltip: 'The total waiting time before retry when a query encounters errors and requires a retry (note: there may be multiple backoff running in parallel so that this may not be a wall time)' lock_keys_time:   Lock Keys Time lock_keys_time_tooltip: Time consumed when locking keys in pessimistic transaction get_commit_ts_time:   Get Commit Ts Time @@ -72,7 +72,7 @@ slow_query: write_sql_response_total:   Send response Time write_sql_response_total_tooltip: Time consumed when sending response to the SQL client exec_retry_time:   Retry execution Time - exec_retry_time_tooltip: Time consumed when retrying the SQL statement execution caused by locks or errors. + exec_retry_time_tooltip: Time consumed when retrying the SQL statement execution caused by locks or errors request_count: Request Count process_keys: Process Keys