1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

MDEV-13301 Optimize DROP INDEX, ADD INDEX into RENAME INDEX

Just rename index in data dictionary and in InnoDB cache when it's possible.
Introduce ALTER_INDEX_RENAME for that purpose so that engines can optimize
such operation.

Unused code between macro MYSQL_RENAME_INDEX was removed.

compare_keys_but_name(): compare index definitions except for index names

Alter_inplace_info::rename_keys:
ha_innobase_inplace_ctx::rename_keys: vector of rename indexes

fill_alter_inplace_info():: fills Alter_inplace_info::rename_keys
This commit is contained in:
Eugene Kosov
2019-03-14 17:28:20 +03:00
committed by Sergei Golubchik
parent 5d8ca98997
commit 3a3d5ba235
13 changed files with 820 additions and 170 deletions

View File

@ -2,7 +2,7 @@ CREATE TABLE t1 (x INT NOT NULL UNIQUE KEY) ENGINE=InnoDB;
INSERT INTO t1 VALUES(5);
SET GLOBAL innodb_log_checkpoint_now=TRUE;
SET DEBUG_SYNC='commit_cache_rebuild SIGNAL ready WAIT_FOR finish';
ALTER TABLE t1 ADD PRIMARY KEY(x);
ALTER TABLE t1 FORCE;;
connect con1,localhost,root,,;
SET DEBUG_SYNC='now WAIT_FOR ready';
SET GLOBAL innodb_log_checkpoint_now=TRUE;
@ -13,7 +13,6 @@ SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`x` int(11) NOT NULL,
PRIMARY KEY (`x`),
UNIQUE KEY `x` (`x`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
DROP TABLE t1;