facebook/mysql-5.6 — pull request #10 by SunguckLee (2014-11-24 06:22:31+00:00)
Title: Defragmentation support for partitioned InnoDB table

Hi Rongrong and Speaphan.

I added some code for defragmentation of partitioned innodb table.
I want this code could be merged facebook version of mysql if there's no problem.

Really thanks for the nice features again.

----------------------------------------------------------------------------------------------------------------------------------
Add defragmentation of partitioned innodb table to Facebook defragmentation feature.
You can specify some partition name for defragmentation with PARTITION phrase.
Without PARTITION phrase, InnoDB will defragment all partition of the table.
And running defragmentation on partition table with async_commit option, InnoDB will defragment all partitioned table in parallel (Not parallel threads, just one thread will defragment all indexes). Defragmentation of several indexes (at the same time) need a lot of disk reads and this cause the latency increasing of user query processing.

** Usage **
## defragment specific partition and index
ALTER TABLE t1 DEFRAGMENT PARTITION (p0sp0, P1SP1) INDEX PRIMARY;

## defragment specific partition without index
ALTER TABLE t1 DEFRAGMENT PARTITION (p0sp0, P1SP1);

## defragment specific index without partition
ALTER TABLE t1 DEFRAGMENT INDEX ix_lname;

## defragment whole partitioned table
ALTER TABLE t1 DEFRAGMENT;

## defragment specific partition and index (async commit)
ALTER TABLE t1 DEFRAGMENT PARTITION (p0sp0, P1SP1) INDEX PRIMARY async_commit;

## defragment specific partition without index (async commit)
ALTER TABLE t1 DEFRAGMENT PARTITION (p0sp0, P1SP1) async_commit;

## defragment specific index without partition (async commit)
ALTER TABLE t1 DEFRAGMENT INDEX ix_lname async_commit;

## defragment whole partitioned table (async commit)
ALTER TABLE t1 DEFRAGMENT async_commit;