pingcap / tidb

TiDB is an open-source, cloud-native, distributed, MySQL-Compatible database for elastic scale and real-time analytics. Try AI-powered Chat2Query free at : https://www.pingcap.com/tidb-serverless/
https://pingcap.com
Apache License 2.0
37.09k stars 5.83k forks source link

Default value of `auto_id_cache` per TiDB Server #56667

Open yahonda opened 4 days ago

yahonda commented 4 days ago

Feature Request

Is your feature request related to a problem? Please describe: Users migrate from MySQL to TiDB who expect auto_increment value increases monotonic, they prefer auto_id_cache = 1. To make use of this change, they need to update DDL statements manually to reflect auto_id_cache = 1.

Describe the feature you'd like: Add sysvar to set TiDB server level default auto_id_cache value. This default value can be 30000. That does not change the current behavior. When this auto_id_cache sysvar changed to 1, auto_id_cache value for coming DDL will respect this value. while the DDL has set auto_id_cache value explicitly, auto_id_cache value in the DDL should be used.

Describe alternatives you've considered: Rewrite DDL statements manually.

Teachability, Documentation, Adoption, Migration Strategy:

yahonda commented 4 days ago

There was a similar request #55716 for shard row id bits and pre split regions.