![]() ![]() Mysql> create table t1 (c1 char (10), c2 char (10)) Type '\c' to clear the current input statement. Other names may be trademarks of their respective Oracle is a registered trademark of Oracle Corporation and / or itsĪffiliates. Server version: 8.0.28 Source distributionĬopyright (c) 2000, 2022, Oracle and / or its affiliates. ADD COLUMN " had behaved in MySQL 8.0.28 (before MySQL 8.0.29 introduced the optimization, described in this article): This feature enables users to ADD new columns "INSTANTLY" to a table irrespective of table size. In other words, " don't touch any row but update the metadata only" is the core idea we came up with to solve it.Īcknowledging users requests, an early implementation of ADD COLUMN with ALGORITHM=INSTANT was added in MySQL 8.0.12. Therefore, if we could come up with a mechanism in which this "need" is omitted and we could achieve ADD/DROP COLUMN by just modifying the metadata. The root cause of problem statement is clear : " the need of modifying all existing records in the table for ADD/DROP COLUMN". And that's why o ne of the most asked feature requests from MySQL users is to have capability to ADD/DROP new/existing column(s) to/from an InnoDB Table, instantly. ![]() InnoDB, the default storage engine for MySQL, is not an exception here. And, as the number of rows in the table increases, time taken to modify all existing rows to reflect the table definition change because of ADD/DROP columns also increases. Now, if a new column is to be added or an old column is to be dropped from a table, the contents of existing rows should be changed to reflect the correct values of columns present in the table. In databases, rows are persisted on disk and for every row, columns' value are stored on disk. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |