# Insertion Hotspot Issue Resolution for Table with Clustered Index for Primary Key Table - Cont'd

+ **`AUTO_RANDOM(5)`** is the default setting for **`AUTO_RANDOM`**
+ **`AUTO_RANDOM / AUTO_RANDOM(3) / AUTO_RANDOM(3, 64)`** example:

| 1 bit | 3 bits | 60 bits          |
| :---- | :----- | :--------------- |
| Sign  | Random | `AUTO_INCREMENT` |

```
tidb> SELECT id >> 60 as shard,
  COUNT(1) as rows_by_shard
  FROM test.auto_random_t1
  GROUP BY shard;

+-------+---------------+
| shard | ~!@rows_by_shard@!~ |
+-------+---------------+
|     2 |           103 |
|    12 |           107 |
|     0 |           113 |
|     4 |           106 |
|    10 |            97 |
|    14 |            71 |
|     8 |           104 |
|     6 |            99 |
+-------+---------------+
8 rows in set (0.00 sec)
```

------------------------------------------------------------------------------
In this example, there are 3 random bits, 1 sign bit, and the remaining 60 bits are incremental bits. For the sign bit, if the column is declared as `UNSIGNED BIGINT`, it is set to 0; for `BIGINT`, it can be 0 or 1. 

It is important to note that the example query shown on the slide utilizes a right shift on the `id` column to demonstrate that the inserted 800 rows are evenly distributed based on the random bits.

The random bits are generated as a hash value of the current transaction start time. It is possible to specify the number of random bits, for instance, `AUTO_RANDOM(3)` indicates that there are 3 random bits. The incremental bits are assigned values in a sequential order, with each assigned value being incremented by 1. When the incremental bits run out, an error message `Failed to read auto-increment value from storage engine.` is thrown if an attempt is made to allocate a new value automatically. 

Generally, the number of random bits can be set to a square number with TiKV Store count as the base and 2 as the exponent. For example, if you have 8 TiKV Stores, setting the random bits to 3 (with 2 as the base) would be sufficient. This approach aims to evenly distribute the values inserted into the 8 TiKV Stores.