June 19, 2013

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

…: 0 mysql> SHOW CREATE TABLE test\G *************************** 1. row *************************** Table: test Create Table: CREATE TABLE `test` ( `id` int(11) NOT NULL AUTO_INCREMENT, `col2` int(11) DEFAULT… 5.7 the checks will be stricter: in the default SQL mode, a duplicate index will throw a warning instead of… null # `id` int(11) not null auto_increment # To shorten this duplicate clustered index, execute: ALTER TABLE `test`.`test` DROP INDEX `redundant`, ADD INDEX…

Post: Using MMM to ALTER huge tables

…to remove auto_increment or change ENUM values. When it comes to changes that really require table to be … the sql scripts $ mysql -u root db < changes.sql At this step we load sql commands from changes.sql …db1 at this stage. If you’re altering gigabyte size tables, this step may take some time. …

Post: Ultimate MySQL variable and status reference list

auto_increment_incrementblogpercona.commanual auto_incrementalter_db_upgradeblogpercona.commanual Com_alter_eventblogpercona.commanual Com_alter_functionblogpercona.commanual Com_alter_procedureblogpercona.commanual Com_alter_serverblogpercona.commanual Com_alter_tableblogpercona.commanual Com_alter

Post: Improved InnoDB fast index creation

… -uroot test –innodb-optimize-keys > dump_optimized.sql $ time mysql -uroot test < dump_unoptimized.sql real 2m52.785s user 0m3.179s sys… ALTER TABLE after restoring the data from a dump would actually make the restore slower; mysqldump –innodb-optimize-keys ignores indexes on AUTO_INCREMENT

Post: Statement based replication with Stored Functions, Triggers and Events

… servers you will break your replication and the SQL process will stop with an error. Example: mysql>… but in this case we alter every event adding DISABLE ON SLAVE. ALTER EVENT even_name DISABLE ON … have gaps? Example: Imagine the table has this values on the auto incremental column: 1,2,3,5 Then …

Comment: Database problems in MySQL/PHP Applications

… help increase security against sql injection. > For …auto_increment functionality This is right. With some > exception however. For example Innodb tables do internal full table > lock if auto_incrementALTER TABLE or OPTIMIZE TABLE > now locks small table for few seconds rather than giant 100GB table

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

…-text search, in the sense that the SQL required to run a MATCH .. AGAINST is the… one, the following warning is generated: mysql> alter table dir_test_innodb ADD FULLTEXT KEY (full_name,…: mysql> CREATE TABLE dir_test_innodb4 (fts_doc_id BIGINT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY); ERROR…

Comment: Real-Life Use Case for "Barracuda" InnoDB File Format

… has been performed by simple ALTER TABLE. Some table-related info: CREATE TABLE `document_queries` ( `id` int(11) NOT NULL AUTO_INCREMENT, `word_document_id` int… Max_data_length: 0 Index_length: 43614208 Data_free: 0 Auto_increment: 3442149 Create_time: 2008-04-21 19:25:22 Update…

Comment: Duplicate indexes and redundant indexes

table if exists emp; drop table if exists dept; create table dept ( deptid integer auto_increment primary key, deptname varchar(20) ); create table emp ( empid integer auto_incrementalter table

Comment: Spreading .ibd files across multiple disks; the optimization that isn't

ALTER TABLE will work correctly, etc. Now consider that there are two sets of tables in the_db, transactional tables and log tablestable the_db.trx1(c1 int auto_increment, c2 int, c3 int, primary key(c1))engine=innodb; create table the_db.trx2(c4 int auto_increment…as a table with respect to SQL. The…