What is the reason for the "Prewrite Phase Duration" and "Commit Phase Cumulative Backoff Duration" in TiDB Dashboard's slow queries far exceeding the total duration of other phases?

Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.

Original topic: TiDB Dashboard 的慢查询里“Prewrite 阶段耗时”和“Commit 阶段累计 Backoff 耗时”远远超过其它阶段耗时的总和是什么原因?

| username: TiDBer_Du4yhZSk

[TiDB Usage Environment] Production Environment
[TiDB Version] v6.1.0

In the TiDB Dashboard, many slow queries were found. From the execution time, it is not clear which specific stage is slow. Additionally, the “Prewrite stage duration” and “Commit stage cumulative Backoff duration” far exceed the total duration of other stages.

| username: dba远航 | Original post link

Both of these stages involve disk IO writes, which are likely to be time-consuming and may also suffer from poor IO performance.

| username: lemonade010 | Original post link

Test the disk’s IO performance.

| username: tidb菜鸟一只 | Original post link

It’s still a locking issue.

| username: Soysauce520 | Original post link

Look further into the execution plan, there should be a lock.