Not the answer you need?
Register and ask your own question!

Optimize table removes the data directory in partitions

ChavyChavy ContributorInactive User Role Beginner
CREATE TABLE `TEST` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `a2` mediumtext NOT NULL,
  `a3` char(100) NOT NULL,
  `prt` tinyint(1) unsigned NOT NULL,
  PRIMARY KEY (`id`,`prt`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED
/*!50100 PARTITION BY LIST (`prt`)
(PARTITION p0 VALUES IN (0) ENGINE = InnoDB,
 PARTITION p1 VALUES IN (1) DATA DIRECTORY = '/tmp' ENGINE = InnoDB) */;
OPTIMIZE TABLE TEST;
It becomes:
CREATE TABLE `TEST` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `a2` mediumtext NOT NULL,
  `a3` char(100) NOT NULL,
  `prt` tinyint(1) unsigned NOT NULL,
  PRIMARY KEY (`id`,`prt`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=FIXED
/*!50100 PARTITION BY LIST (`prt`)
(PARTITION p0 VALUES IN (0) ENGINE = InnoDB,
 PARTITION p1 VALUES IN (1) ENGINE = InnoDB) */;
Partition p1 moves from /tmp into main mysql db directory (in datadir)

Percona: 5.6.21-69.0

Comments

Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.