TiDB Keeps Restarting When the Table is Very Large

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

Original topic: 但表很大时tidb不断的重启

| username: tidb狂热爱好者

【TiDB Usage Environment】Test environment
【TiDB Version】
6.1
【Encountered Problem】
【Reproduction Path】What operations were performed to cause the problem
【Problem Phenomenon and Impact】
Table object with 2 billion records. Users continuously update and delete, causing the tidb-server to keep restarting. Even with memory increased to 256GB, it cannot start normally.
【Attachments】

Please provide the version information of each component, such as cdc/tikv, which can be obtained by executing cdc version/tikv-server --version.

| username: xfworld | Original post link

Can you provide information on the scope of update and delete transactions? For example, how many records need to be processed at one time, etc.

| username: HACK | Original post link

Are there any OOM errors?

| username: Raymond | Original post link

Is the amount of data modified by a single transaction too large? It is recommended to split the transaction or set a maximum memory usage threshold for the statement.

| username: xuexiaogang | Original post link

It’s normal to keep updating. Here, I need to ask, are you operating on 2 billion rows each time?

| username: 张雨齐0720 | Original post link

Check the Dashboard to see if you can find slow SQL, large result sets, and large transaction SQL.

| username: Z六月星星 | Original post link

Analyze the UPDATE and DELETE statements.

| username: cs58_dba | Original post link

Generally, the conditions for update and delete should use indexes, then control the scan range of the conditions, and handle a few million rows at a time.

| username: tidb狂热爱好者 | Original post link

Delete the entire table and insert the entire table.

| username: tidb狂热爱好者 | Original post link

512GB of memory is used up, then OOM, and it keeps looping like this.

| username: GreenGuan | Original post link

Large transactions in the TP database have many complications; it is recommended to reduce the transaction size.

| username: xfworld | Original post link

It’s not quite appropriate, this kind of operation… :cowboy_hat_face:

But, it’s just a test, so just play around.

| username: cs58_dba | Original post link

Checking the large table once a day should be sufficient.

| username: tidb狂热爱好者 | Original post link

Large table loop queries can execute thousands of queries per second. These developers lack SQL experience. Should we limit the frequency? Each execution takes only about 3ms.

| username: system | Original post link

This topic was automatically closed 1 minute after the last reply. No new replies are allowed.