Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated the Schema Cache limitations #19374

Merged
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions schema-cache.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,8 @@ 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 `AUTO_INCREMENT` or `AUTO_RANDOM`, a small schema cache size might cause these tables to frequently enter and leave the cache, which can be monitored 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, consider the following measures:
hfxsd marked this conversation as resolved.
Show resolved Hide resolved

- Increase the schema cache size to reduce frequent evictions.
Copy link
Collaborator

@hfxsd hfxsd Nov 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Increase the schema cache size to reduce frequent evictions.
- 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 sharding bits and reserved bits for AUTO_RANDOM to avoid having a limited ID range.
hfxsd marked this conversation as resolved.
Show resolved Hide resolved
Loading