Skip to content

Commit

Permalink
Updated the Schema Cache limitations (#19374) (#19383) (#19384)
Browse files Browse the repository at this point in the history
  • Loading branch information
ti-chi-bot authored Nov 12, 2024
1 parent ab639a7 commit 747beea
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions schema-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ In scenarios with a large number of databases and tables, the following known is
- `SHOW FULL TABLES`
- `FLASHBACK`
- `ALTER TABLE ... SET TIFLASH MODE ...`
- When you use tables with the [`AUTO_INCREMENT`](/auto-increment.md) or [`AUTO_RANDOM`](/auto-random.md) attribute, a small schema cache size might cause these tables to frequently enter and leave the cache. You can monitor it through the schema cache hit rate and size on the monitoring panel. This can result in the allocated ID range becoming invalid before being fully used, leading to ID jumps. In write-intensive scenarios, this might even exhaust the ID range. To minimize abnormal ID allocation behavior and improve system stability, it is recommended to take the following measures:

- Increase the schema cache size to reduce frequent evictions.
- When you use tables with the [`AUTO_INCREMENT`](/auto-increment.md) or [`AUTO_RANDOM`](/auto-random.md) attribute, a small schema cache size might cause the meta data of these tables to frequently enter and leave the cache. This can result in the allocated ID range becoming invalid before being fully used, leading to ID jumps. In write-intensive scenarios, this might even exhaust the ID range. To minimize abnormal ID allocation behavior and improve system stability, it is recommended to take the following measures:

- View the hit rate and size of the schema cache on the monitoring panel to assess whether the cache settings are reasonable. Increase the schema cache size properly to reduce frequent evictions.
- Set [`AUTO_ID_CACHE`](/auto-increment.md#auto_id_cache) to `1` to prevent ID jumps.
- Properly configure the shard bits and reserved bits of `AUTO_RANDOM` to avoid a too small ID range.
- Properly configure the shard bits and reserved bits of `AUTO_RANDOM` to avoid a too small ID range.

0 comments on commit 747beea

Please sign in to comment.