[MDEV-13076] AliSQL: [Feature] Issue#43 Add Column Dynamically Created: 2017-06-13  Updated: 2017-10-20  Resolved: 2017-10-20

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Fix Version/s: 10.3.2

Type: Task Priority: Major
Reporter: Sergey Vojtovich Assignee: Marko Mäkelä
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Duplicate
duplicates MDEV-11369 Instant add column for InnoDB Closed
Epic Link: AliSQL patches

 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



 Comments   
Comment by Sergey Vojtovich [ 2017-10-20 ]

marko, could you confirm your patch covers this?

Comment by Marko Mäkelä [ 2017-10-20 ]

This Alibaba contribution looks similar to the one that was contributed by Tencent as pull request #408 and mostly rewritten by me.

Both contributions are modifying some code outside InnoDB. My version of MDEV-11369 only modifies InnoDB code, supports instant ADD COLUMN for ROW_FORMAT=REDUNDANT tables without changing the info_bits.

The Tencent contribution probably is a further development of this, incorporating some of the design improvements that were brainstormed in April between myself and engineers from Tencent and Alibaba (see the comment in MDEV-11369). Unlike this contribution, it would support instant ADD on existing tables (such as after an upgrade), without changing any SQL syntax.

Therefore, I am closing this as a duplicate of MDEV-11369.

Generated at Thu Feb 08 08:02:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.