Slow autorandom insertion

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

Original topic: autorandom插入慢

| username: Hacker_ythhI9Qd

[Test Environment for TiDB] Testing
[TiDB Version] 5.7.25-TiDB-v4.0.16
[Reproduction Path] id as bigint(20) AUTO_RANDOM(5)
[Encountered Issue: Problem Description and Impact] During stress testing, it was found that inserting some data with transactions took up to 7 seconds.
[Resource Configuration] Go to TiDB Dashboard - Cluster Info - Hosts and take a screenshot of this page
[Attachments: Screenshots/Logs/Monitoring]
Is the performance of AUTO_RANDOM not good in this version?

| username: 裤衩儿飞上天 | Original post link

It should be writing hotspots. 4.X does not have clustered tables yet.

| username: 啦啦啦啦啦 | Original post link

Version 4.0 is indeed a bit outdated. Consider upgrading to 6 or above.

| username: Hacker_ythhI9Qd | Original post link


| username: Hacker_ythhI9Qd | Original post link

The company has no upgrade plans.

| username: 裤衩儿飞上天 | Original post link

  1. Sorry, I didn’t notice that you are already using autorandom, so you cannot set SHARD_ROW_ID_BITS.
  2. It is still recommended to upgrade the version, as the new version has significant improvements.
  3. If there are no plans to upgrade, then check the monitoring to see where the slowness is, where the bottlenecks are. During stress testing, pay close attention to CPU and IO, and then analyze further.
| username: redgame | Original post link

Use application-level UUID and Snowflake algorithm

| username: system | Original post link

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.