June 19, 2013

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

…=latin1 1 row in set (0.00 sec) In previous versions of MySQL, you can create two indexes with the same columns (in the same…: mysql> ALTER TABLE test ADD INDEX (col2); Query OK, 0 rows affected (0.34 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> ALTER TABLE test ADD INDEX (col2, col3); Query

Post: Should you name indexes while doing ALTER TABLE ?

…=latin1 1 row in set (0.00 sec) Such automatically table generated names are not really helpful for multiple column indexes – you can…: mysql> alter table t1 add key(i); Query OK, 0 rows affected (0.00 sec) Records: 0 Duplicates: 0 Warnings: 0 mysql> alter table t1 add key(i); Query OK…

Post: Hijacking Innodb Foreign Keys

mysql> alter table parent rename parentx; Query OK, 0 rows affected (0.05 sec) mysql> drop table parentx; Query OK, 0 rows affected (0.61 sec) mysqltable the same way as when there are non existing rows – if you’re trying to change “parent_id” column in child table

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

mysql> alter table dir_test_innodb ADD FULLTEXT KEY (full_name, details); Query

Post: Find and remove duplicate indexes

column and MySQL won’t complain. Let’s see this example: mysql> alter table t add index(name); mysql> alter table t add index(name); mysql> alter table t add index(name); mysql> show create table

Post: Quickly finding unused indexes (and estimating their size)

column_name order by SEQ_IN_INDEX ASC SEPARATOR ‘,’) as COLUMN_NAMES from information_schema.tables t join information_schema.statistics i using (table_schema, tabletable, then you can rebuild the tablespace for your table by simply doing: mysql> alter table

Post: Concatenating MyISAM files

….00 sec) mysql> truncate table test_concat_part; Query OK, 0 rows affected (0.01 sec) mysql> alter table test_concat add data varchar(10); Query OK, 0… | four | | 5 | five | | 6 | six | +—-+——-+ 6 rows in set (0.00 sec) So varchar columns are supported without any issue but, deleted…

Post: InnoDB Full-text Search in MySQL 5.6: Part 2, The Queries!

column named “value”. OK, sounds easy enough: mysql: SHOW CREATE TABLE innodb_myisam_stopword\G *************************** 1. row *************************** Table: innodb_myisam_stopword Create Table: CREATE TABLEALTER TABLE foo ENGINE=InnoDB. In theory, yes. In

Post: Thinking about running OPTIMIZE on your Innodb Table ? Stop!

column or something similar. It also produces a lot better fill factor. The problem is…. OPTIMIZE TABLE for Innodb tables… | +——–+———-+———-+——————————————————————-+ 2 rows in set (4 min 5.52 sec) mysql> alter table a add key(c); Query OK,…