Details
-
Task
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
None
Description
Description:
|
------------
|
The original adding column will move the data. it will consume long time.
|
Now the new row_format COMFORT for InnoDB can add column dynamically.
|
|
The innodb comfort record format such as:
|
[lens | n_nulls | n_fields | extra | id...]
|
1. extra info_bits will occupy 1 bit to flag comfort.
|
2. n_fields will occupy 1 or 2 bytes to save the column number.
|
|
Then add column action will only change the dictionary and cache.
|
|
Limition:
|
---------
|
The column only can added at last, and nullable, non-default value.
|
|
Usage:
|
------
|
create table t (id int) engine=innodb row_format=comfort.
|
alter table t add col1 int;
|
https://github.com/alibaba/AliSQL/commit/70ad701de15cd1e872127ed01e016a193b4c723c
Attachments
Issue Links
- duplicates
-
MDEV-11369 Instant add column for InnoDB
- Closed