The update statement in TiDB is very slow

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

Original topic: tidb 的update语句很慢

| username: 烂番薯0

In the test environment, I found that the update statement actually took 50 seconds. After looking at the execution plan, I didn’t see any issues. Could the experts here please explain the reason for this?

Here is the SQL:

This is from the dashboard:

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

This is not a problem yet. The parsing time is already so long. Check your server resources to see if they are exhausted…

| username: 烂番薯0 | Original post link

How can I see which specific node is causing this?

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

First, take a look at the Grafana monitoring under TiDB’s Executor.

| username: 烂番薯0 | Original post link

Is this high, boss? I can’t understand this :sweat_smile:

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

This should normally be in microseconds or milliseconds, but you’ve reached seconds…

| username: Jolyne | Original post link

The time taken for these two tasks is a bit high. Could it be that resource consumption is too high at this time? Check the resource status at the corresponding time.

| username: 烂番薯0 | Original post link

Oh… so this means the machine’s memory is insufficient, right? The machine’s memory is indeed insufficient :rofl:

| username: 烂番薯0 | Original post link

Yes, it is quite high. There were quite a few scripts just now.

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

This is a test environment, right? Please provide the cluster topology diagram. It should be a resource issue. Normal parsing is a very lightweight operation and shouldn’t take long unless resources are severely lacking…

| username: zhaokede | Original post link

Parsing took 42.8 seconds, and generating the execution plan took 6 seconds. It seems like there is no computing power left.

| username: 烂番薯0 | Original post link

The test environment is basically reused.

| username: 烂番薯0 | Original post link

Is it because of insufficient memory?

| username: 这里介绍不了我 | Original post link

How is the load situation on these two machines now?

| username: 烂番薯0 | Original post link

Brother, what does this error mean?

| username: 烂番薯0 | Original post link

Currently, it’s basically not high, around 0.04.

| username: 这里介绍不了我 | Original post link

Which metric does 0.04 refer to?

| username: TiDBer_LM | Original post link

free -m
top
Let’s take a look?

| username: 烂番薯0 | Original post link

The average CPU load.

| username: 烂番薯0 | Original post link

The image is not visible. Please provide the text you need translated.