pingcap/tidb

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

Open

#40.574 geöffnet am 13. Jan. 2023

Auf GitHub ansehen
 (3 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Go (6.186 Forks)batch import
help wantedtype/enhancement

Repository-Metriken

Stars
 (40.090 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 14T 4h) (346 gemergte PRs in 30 T)

Beschreibung

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.

Contributor Guide