indexing - Can I create an index in mysql without invoking creation of a temporary table the size of my target table? -
mysql 5.05 hosting older application still gets lots of love users. unfortunately, i'm not other hack dba @ best, , hesitant in skills safely migrate new version of database unless absolutely necessary. in process of procuring new application take on responsibilities old application, year out or so.
anyway, patching application other day , added column table, command took while complete , in meantime filled drive hosting datafiles. (table 25g) believe function of creation of temporary table. reasons i'm not clear on, space did not become free again after column added; i.e., lost 25g of disk space. believe (?) due fact database created single datafile; i'm not sure on whys, know had free space elsewhere drive operable state.
that being said, i've got column added, worthless application without index. held off adding index trying figure out if going create massive, persistent 'temporary' table @ index creation time. can out there give me insight into:
will create index , or alter table create index statement result in creation of temporary table same size existing table?
how can recover space got added ibdata1 when added column?
any , advice appreciated.
mysql prior version 5.1 adds/removes indices on innodb tables building temporary tables. it's slow , expensive. way around either upgrade mysql 5.1, or dump table e.g.
mysqldump
, drop it, recreate new indices, , restore dump.you can't shrink
ibdata1
@ all. solution rebuild scratch. possible configure mysql doesn't use 1 giant ibdata1 file databases - read answer , explain how configure mysql/innodb doesn't happen again, , how safely dump , recreate databases.
ultimately, want to
- make complete dump of database
- upgrade mysql 5.1 or newer
- turn on innodb one-file-per-table mode
- restore dump.
Comments
Post a Comment