You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if SQL 3 and SQL 4 in the upper has same SQL digest, we the transaction SQL digest can be below:
sql_1 digest
sql_2 digest
sql_3 digest -- suppose SQL 4 has the same digest with SQL 3
sql_5 digest
Then we can use upper sql digests to generate a transaction digest.
How to collect the information?
Set tidb_slow_log_threshold variable to 0 value, then TiDB will record the every execute SQL. Then use txn_start_ts to get the sqls that execution in the transactions. such as below:
SELECTMIN(time)
,COUNT(*)
,MIN(query_time)
,AVG(query_time)
,MAX(query_time)
,SUM(query_time)
,MIN(query)
,MIN(plan)
FROM`SLOW_QUERY`WHERE txn_start_ts=417754666182377492ANDtime>"2020-07-01 20:43:50"ANDtime<"2020-07-01 20:45:53"GROUP BY digest,plan_digest
ORDER BYMIN(time)\G
The text was updated successfully, but these errors were encountered:
@scsldb This reveals how TiDB clients (e.g. JDBC / Application) send SQL queries, which can identify the root cause when TiDB resource is not fully utilized.
Feature Request
Is your feature request related to a problem? Please describe:
Add a page such as below:
It's easy to see the total time of each transaction type and the related SQL in the transaction, and the time gap between each SQLs.
How to classify the transaction?
We can generate a digest for the transaction:
Here is a transaction example:
if SQL 3 and SQL 4 in the upper has same SQL digest, we the transaction SQL digest can be below:
sql_1 digest sql_2 digest sql_3 digest -- suppose SQL 4 has the same digest with SQL 3 sql_5 digest
Then we can use upper sql digests to generate a transaction digest.
How to collect the information?
Set
tidb_slow_log_threshold
variable to0
value, then TiDB will record the every execute SQL. Then usetxn_start_ts
to get the sqls that execution in the transactions. such as below:The text was updated successfully, but these errors were encountered: