… ALTER TABLE performance with fast index creation and without it with different buffer pool sizes. Results are pretty interesting. I used modified Sysbench table…. I used 10mil row table which would look as following in terms of data and index size: mysql> show table status like “sbtest…
Post: On Character Sets and Disappearing Tables
…) ) ENGINE=INNODB; trying to do something like “ALTER TABLE bar DROP j” or “ALTER TABLE bar MODIFY COLUMN j j SMALLINT NOT NULL” will produce… in a new session. We move on to table 2: (root@localhost) [oops4]> alter table dos2 change column fkto3 fkto3 char(32) character… I think there’s something of an inconsistency present when MySQL won’t allow us to change an FK-referenced column…
Post: Best kept MySQLDump Secret
… how MySQL‘s Transactions work with DDL, In particular ALTER TABLE. When ALTER TABLE is Performed in many cases it will Create temporary table with modified structure… –single-transaction dumptest > dump.sql SESSION1: (before dump has completed) mysql> alter table C add i int not null; Query OK, 1 row…
Post: Full table scan vs full index scan performance
… costs? Let’s take the employees database, and slightly modify the employees tables: mysql> ALTER TABLE employees ADD INDEX idx_first (first_name),ENGINE=InnoDB…. Now let’s modify the query by selecting only the first_name field instead of selecting all the fields: mysql> explain SELECT…
Post: Improved InnoDB fast index creation
… table rebuilds without affecting the table size. mysql> SET expand_fast_index_creation=ON; Query OK, 0 rows affected (0.00 sec) mysql> ALTER TABLE t MODIFY…) mysql> ALTER TABLE t MODIFY v VARCHAR(8); Query OK, 4194304 rows affected (1 min 13.69 sec) Records: 4194304 Duplicates: 0 Warnings: 0 mysql> ALTER TABLE…
Post: Converting Character Sets
… TABLE `t1` ( ->Â Â `c1` text NOT NULL -> ) ENGINE=MyISAM DEFAULT CHARSET=latin1; Query OK, 0 rows affected (0.02 sec) mysql> ALTER TABLE… to be. Consider the following ALTER statement against the table in Approach #1: ALTER TABLE `t1` DEFAULT CHARSET=utf8, MODIFY COLUMN `c1` text CHARACTER SET…
Post: A recovery trivia or how to recover from a lost ibdata1 file
…/var/lib/mysql/recover/ chown mysql.mysql /var/lib/mysql/recover/$CURRENT_TABLENAME.ibd sleep 1 echo “importing tablespace” mysql -u root -e “alter table recover.$CURRENT…extra column. With a modified schema, the recovery completed. The customer was able to download the tables in MyISAM format and …
Post: Data compression in InnoDB for text and blob fields
… or MySQL 5.5) you can now leverage table compression by specifying ROW_FORMAT=COMPRESSED. In our case we only wanted MySQL to… CREATE TABLE or ALTER TABLE statements. In our case, we chose to re-build the table using ALTER TABLE via a null-operation like this: ALTER TABLE `t1… 2.1 in order to modify the table if you cannot sustain the blocking effects of a traditional ALTER TABLE statement. I hope this…
Post: Filtered MySQL Replication
… fan of filtered or partial MySQL Replication (as of version MySQL 5.0) – there is enough …as there is no any real data to modify. Daniel Schneller wrote pretty good tutorial on …tables to be replicated to the slaves. Another issue is of course creating and altering tables. If you have Innodb tables…

