pingcap/tidb

Optimize DDL for CHAR(10) to VARCHAR(100)

Open

#40,574 opened on 2023年1月13日

GitHub で見る
 (3 comments) (0 reactions) (0 assignees)Go (6,186 forks)batch import
help wantedtype/enhancement

Repository metrics

Stars
 (40,090 stars)
PR merge metrics
 (平均マージ 14d 4h) (30d で 346 merged PRs)

説明

Feature Request

Changing a column from a CHAR(n) to a VARCHAR(m) is now going through a full reorg. However the CHAR is guaranteed to fit in the VARCHAR as long as the charset remains the same and if m>=n.

Here the source is a CHAR and the target is a VARCHAR, but this is likely also true for any other combination of these types and might also be true for VARBINARY etc.

The improvement would be to do this as a metadata only change and only change the actual rows when they are written again.

コントリビューターガイド