[MDEV-16849] Extending indexed VARCHAR column should be instantaneous Created: 2018-07-30 Updated: 2019-02-04 Resolved: 2019-01-30 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.2, 10.3 |
| Fix Version/s: | 10.4.3, 10.2.22, 10.3.13 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Marko Mäkelä | Assignee: | Thirunarayanan Balathandayuthapani |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | ddl, instant | ||
| Issue Links: |
|
||||||||||||||||||||||||||||
| Description |
|
MySQL 5.7 (which was merged to MariaDB 10.2.2) implements an instantaneous change of the maximum length of a VARCHAR column when the length is increasing and not crossing the 255-byte boundary. Alas, when the VARCHAR column was indexed, the indexes would be dropped and added. This should be avoided. MySQL 5.7.23 addressed this by changing the storage engine API. We would prefer a less intrusive change. InnoDB should be able to ‘optimize away’ pairs of DROP INDEX and ADD INDEX operations. (While doing that, InnoDB in MariaDB should support the renaming of indexes as well, without introducing the RENAME INDEX syntax from MySQL 5.7.) |
| Comments |
| Comment by Marko Mäkelä [ 2018-09-20 ] | |
|
While implementing this, please see if in ROW_FORMAT=REDUNDANT, we can also extend VARCHAR from any size to any size. The limitation regarding the 255-byte maximum length only applies to other ROW_FORMAT. | |
| Comment by Marko Mäkelä [ 2018-10-24 ] | |
|
Somehow, the commit in MySQL 5.7.23 was cherry-picked and pushed to 5.7.24. These commits are equivalent according to the output of the following command:
| |
| Comment by Thirunarayanan Balathandayuthapani [ 2018-10-24 ] | |
|
Patch is in bb-10.2-MDEV-16849 | |
| Comment by Marko Mäkelä [ 2018-10-31 ] | |
|
There is only a trivial change to InnoDB; the rest is done in the SQL layer. | |
| Comment by Thirunarayanan Balathandayuthapani [ 2019-01-29 ] | |
|
Addressed the review comments. |