背景
最近在工作工程中遇到一个关于MySQL分区表索引的问题
研究过程
代码片段
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| CREATE TABLE `test_a` ( `id` int(11) NOT NULL AUTO_INCREMENT, `create_time` datetime NOT NULL, `col` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`,`create_time`), KEY `index_create_time` (`create_time`) ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1
;
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| CREATE TABLE `test_b` ( `id` int(11) NOT NULL AUTO_INCREMENT, `create_time` datetime NOT NULL, `col` varchar(45) DEFAULT NULL, PRIMARY KEY (`id`,`create_time`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1
;
|
总结
后记