pingcap/tidb

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

Open

#40,574 建立於 2023年1月13日

在 GitHub 查看
 (3 留言) (0 反應) (0 負責人)Go (6,186 fork)batch import
help wantedtype/enhancement

倉庫指標

Star
 (40,090 star)
PR 合併指標
 (平均合併 14天 4小時) (30 天內合併 346 個 PR)

描述

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.

貢獻者指南