May 22, 2012

Post: Hacking to make ALTER TABLE online for certain changes

… want to remove auto_increment from 100G table. No matter if it’s InnoDB or MyISAM, you’d usually ALTER TABLE `huge_table` CHANGE `id` `id…, but works well with both – InnoDB and MyISAM. Now that more and more folks hit the InnoDB auto-inc scalability issue with MySQL 5.0 and older versions, employing other techniques to maintain the PK auto incremental becomes…

Post: Avoiding auto-increment holes on InnoDB with INSERT IGNORE

….1.22 InnoDB used a method to access that counter values called “Traditional”. This one uses a special table lock called AUTO-INC that… TABLE `foo` ( `id` int(11) NOT NULL AUTO_INCREMENT, `name` int(11) DEFAULT NULL, PRIMARY KEY (`id`), UNIQUE KEY `uniqname` (`name`) ) ENGINE=InnoDB AUTO… customer. So, if this saves you from doing an ALTER TABLE to change the auto incremental column size, then send him a beer ;)