June 19, 2013

Post: The small improvements of MySQL 5.6: Duplicate Index Detection

…) Records: 0 Duplicates: 0 Warnings: 0 mysql> ALTER TABLE test ADD INDEX (col2); Query OK, 0 rows affected, 1 warning (0…` (`col2`), # KEY `col2_2` (`col2`,`col3`) # Column types: # `col2` int(11) default null # `col3` varchar(200) default null # To remove this duplicate index… definitions: # KEY `redundant` (`col2`,`id`) # PRIMARY KEY (`id`), # Column types: # `col2` int(11) default null # `id` int(11) not null auto_increment…

Post: Understanding the maximum number of columns in a MySQL table

… it’s why we can’t have nice things (like default values other than NOW()). It also has certain limits which…(REC_MAX_N_FIELDS – DATA_N_SYS_COLS * 2) Which adds up to (1024-1)-3*2=1017 which is …I was able to hit a too many columns error with only 192 columns (i.e. 191 worked): sub cname ($$) { my $c…

Post: Is Synchronous Replication right for your app?

… someone joins a group, you run a transaction that adds the relationship row to users_groups, but also …only the number of times specified by this variable (default is 1 retry).  This means more waiting, and … Example 2, above, how above moving the ‘joined’ column to the users_groups table so we don’…

Post: pt-online-schema-change and default values

… can ignore default value and it will be assigned based on the column type. For example this alter table sbtest add column v varchar(100) not null would work even though we do not specify default value. MySQL will assign empty string as default default

Post: InnoDB Full-text Search in MySQL 5.6 (part 1)

…FULLTEXT KEY `full_name` (`full_name`,`details`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 We also have identical tables created…add column FTS_DOC_ID | +———+——+————————————————–+ This doesn’t make a lot of sense to me. Why does InnoDB need to add a hidden column

Post: Improved InnoDB fast index creation

… table rebuild by adding a new column and see what execution time is like when the default method is used: mysql> SET profiling=1; Query OK, 0 rows affected (0.00 sec) mysql> ALTER TABLE t ADD COLUMN… index creation provides even better performance as compared to the default method, because it does not have to do random disk…

Post: Knowing what pt-online-schema-change will do

…=InnoDB DEFAULT CHARSET=latin1 Created new table test._t_new OK. Altering new table… ALTER TABLE `test`.`_t_new` add column (foo char…`), KEY `guest_language` (`guest_language`,`guest_country`,`score`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 Created new table test._t_new OK. This… –alter statement: Altering new table… ALTER TABLE `test`.`_t_new` add column (foo char(2)) Altered `test`.`_t_new` OK. If the…

Post: Hidden columns of query_review_history table

…, you can manually add and have the following useful columns populated in query_review_history table: * `user_max` varchar(64) DEFAULT NULL – User who executed the query. * `host_max` varchar(64) DEFAULT