tidb

In TiDB is it possible to change the SHARD_ROW_ID_BITS later on after inserting some data?


Hi I have a question on SHARD_ROW_ID_BITS in TiDB. I understand you can specify such as 4 or 5 for this value depending on how much shards you want. Question, is it possible to increase this value in case you want further sharding later? Decreasing?

https://docs.pingcap.com/tidb/stable/shard-row-id-bits


Solution

  • yes. You can use alter statement to do that, like:

    ALTER TABLE t SHARD_ROW_ID_BITS = 4;
    

    Increasing and decreasing are both supported