您好,登錄后才能下訂單哦!
創(chuàng)建表分區(qū)語句:
CREATE TABLE `pub_point_test` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`longitude` double(255,10) DEFAULT NULL,
`latitude` double(255,10) DEFAULT NULL,
`license` varchar(255) DEFAULT NULL,
`gatherTime` bigint(10) NOT NULL,
`clientId` varchar(255) DEFAULT NULL,
`speed` int(11) DEFAULT NULL,
`address` varchar(255) DEFAULT NULL,
`datetime` datetime DEFAULT NULL,
`vehicleId` int(10) DEFAULT NULL,
`mileage` double(255,3) DEFAULT '0.000' COMMENT '單位:百米',
`trackId` varchar(255) DEFAULT NULL,
PRIMARY KEY (`id`,`gatherTime`),
KEY `license_index` (`license`) USING BTREE,
KEY `gatherTime_index` (`gatherTime`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2594032 DEFAULT CHARSET=gbk
partition by range(gatherTime)
subpartition by hash(id)
subpartitions 20
(
partition p20170101 values less than ((TO_DAYS('2016-01-01'))),
partition p20170102 values less than ((TO_DAYS('2016-01-02')))
)
添加子分區(qū)語句
alter table pub_point_test add partition
(
partition p20170103 values less than ((TO_DAYS('2016-01-03'))),
partition p20170104 values less than ((TO_DAYS('2016-01-04')))
)
免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。