partition by RANGE(id)(
partition p0 values less than (5000000),
partition p1 values less than (10000000),
partition p2 values less than (15000000),
partition p3 values less than maxvalue
);
我想每500万数据在一个分区内。先创建了4个分区。
第一个问题: 我显示表的时候,显示的信息如下:
mysql> show create table jobstat\G;
*************************** 1. row ***************************
Table: jobstat
Create Table: CREATE TABLE `jobstat` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`jobNo` varchar(45) DEFAULT NULL,
`clickSum` int(10) unsigned DEFAULT NULL,
`showSum` int(10) unsigned DEFAULT NULL,
`mailSum` int(10) unsigned DEFAULT NULL,
`locationid` varchar(10) DEFAULT NULL,
`logdate` char(8) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `idx_jobstat_jobNo` (`jobNo`) USING BTREE,
KEY `idx_jobstat_logdate` (`logdate`),
KEY `idx_jobstat_locationid` (`locationid`),
KEY `idx_jobstat_jobNo_logdate` (`jobNo`,`logdate`) USING BTREE,
KEY `idx_jobstat_clickSum` (`clickSum`),
KEY `idx_jobstat_showSum` (`showSum`)
) ENGINE=MyISAM AUTO_INCREMENT=14581386 DEFAULT CHARSET=gbk /*!50100PARTITION BY RANGE (id) (PARTITION p0 VALUES LESS THAN (5000000) ENGINE= MyISAM, PARTITION p1 VALUES LESS THAN (10000000) ENGINE = MyISAM,PARTITION p2 VALUES LESS THAN (15000000) ENGINE = MyISAM, PARTITION p3VALUES LESS THAN MAXVALUE ENGINE = MyISAM) */
1 row in set (0.00 sec)