# Split Write Hotspot (A)

+ table schema
  + `SHARD_ROW_ID_BITS 和 PRE_SPLIT_REGIONS` 

```
CREATE TABLE t (c int) SHARD_ROW_ID_BITS = 4;
ALTER TABLE t SHARD_ROW_ID_BITS = 4;
```


![left](./student-guide/diagram/21-Database-object-01-01.png)

------------------------------------------------------------

```
CREATE TABLE t (c int) SHARD_ROW_ID_BITS = 4;
ALTER TABLE t SHARD_ROW_ID_BITS = 4;
```

After understanding the TiDB data organization model, you can try to avoid hot spots at the beginning of database object creation:
table schema
When designing a table schema, you can try to avoid hot spots in the storage of row data in an appropriate way:
- SHARD_ROW_ID_BITS and PRE_SPLIT_REGIONS
Using a non-Int or Bigint primary key, TiDB internally generates an implicit _tidb_rowid by default. At this time, use SHARD_ROW_ID_BITS and PRE_SPLIT_REGIONS to complete the predispersion and segmentation of the region. Specifically, the rowid is written to multiple different regions to alleviate the problem of writing hot spots. However, setting too large results in a large number of RPC request, increasing CPU and network overhead.
  - SHARD_ROW_ID_BITS = 4 
    - Rowid adds 4 random bits
    - Divide into 16 shards