Bug #60810 | some optimizations at alter table | ||
---|---|---|---|
Submitted: | 8 Apr 2011 21:07 | Modified: | 26 May 2011 1:34 |
Reporter: | Roberto Spadim (Basic Quality Contributor) | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: DDL | Severity: | S4 (Feature request) |
Version: | 5.1 | OS: | Any (any) |
Assigned to: | CPU Architecture: | Any | |
Tags: | ALTER TABLE, qc |
[8 Apr 2011 21:07]
Roberto Spadim
[8 Apr 2011 21:55]
Roberto Spadim
maybe... instead of alter table t change a A int not null use something like: alter table t rename a A this don´t need engine code changes (maybe if some engine use field for hash?! i don´t know if engine have case insensitive functions to make hash index or another kind of optimization, verification)
[8 Apr 2011 22:01]
Roberto Spadim
changed to ddl
[11 Apr 2011 14:02]
Valeriy Kravchuk
According to http://dev.mysql.com/doc/refman/5.5/en/alter-table.html renaming column should work without making a temporary table and copying all the data. Other cases discussed here (and renaming column of InnoDB table) are, probably, valid cases for some optimization.
[26 May 2011 1:34]
Roberto Spadim
i was reading http://dev.mysql.com/doc/refman/5.6/en/alter-table.html 5.6 docs and i didn´t found a command to change column name... check: 1) ADD [COLUMN] col_name column_definition [FIRST | AFTER col_name ] 2) ALTER [COLUMN] col_name {SET DEFAULT literal | DROP DEFAULT} 3) CHANGE [COLUMN] old_col_name new_col_name column_definition [FIRST|AFTER col_name] 4) MODIFY [COLUMN] col_name column_definition [FIRST | AFTER col_name] 5) DROP [COLUMN] col_name but no command to rename column.. only change can rename may be a new 6) RENAME COLUMN old_col_name new_col_name could be nice...