mysql> show create table ClientActionTrack\G;
*************************** 1. row ***************************
Table: ClientActionTrack
Create Table: CREATE TABLE `ClientActionTrack` (
`sn` bigint(20) NOT NULL AUTO_INCREMENT,
`clientSn` int(11) DEFAULT NULL,
`ip` varchar(32) DEFAULT NULL,
`url` varchar(1000) DEFAULT NULL COMMENT 'request url',
`httpMethod` varchar(100) DEFAULT NULL COMMENT 'http method',
`requestParams` text COMMENT '请求参数',
`requestHeader` varchar(2000) DEFAULT NULL COMMENT '请求头信息',
`pageUrl` varchar(500) DEFAULT NULL COMMENT '页面Url',
`sessionId` varchar(100) DEFAULT NULL COMMENT 'session的Id',
`startTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '访问开始时间',
`completeTime` datetime DEFAULT NULL COMMENT '访问完成时间',
PRIMARY KEY (`sn`,`startTime`)
) ENGINE=InnoDB AUTO_INCREMENT=302754 DEFAULT CHARSET=utf8 COMMENT='用户访问记录表'
/*!50100 PARTITION BY RANGE (TO_DAYS(startTime))
(PARTITION p20150914 VALUES LESS THAN (736221) ENGINE = InnoDB,
PARTITION p20150915 VALUES LESS THAN (736222) ENGINE = InnoDB,
PARTITION p20150916 VALUES LESS THAN (736223) ENGINE = InnoDB,
PARTITION p20150917 VALUES LESS THAN (736224) ENGINE = InnoDB,
PARTITION p20150918 VALUES LESS THAN (736225) ENGINE = InnoDB,
PARTITION p20150919 VALUES LESS THAN (736226) ENGINE = InnoDB,
PARTITION p20150920 VALUES LESS THAN (736227) ENGINE = InnoDB,
PARTITION p20150921 VALUES LESS THAN (736228) ENGINE = InnoDB,
PARTITION p20150922 VALUES LESS THAN (736229) ENGINE = InnoDB,
PARTITION p20150923 VALUES LESS THAN (736230) ENGINE = InnoDB,
PARTITION p20150924 VALUES LESS THAN (736231) ENGINE = InnoDB,
PARTITION p20150925 VALUES LESS THAN (736232) ENGINE = InnoDB,
PARTITION p20150926 VALUES LESS THAN (736233) ENGINE = InnoDB,
PARTITION p20150927 VALUES LESS THAN (736234) ENGINE = InnoDB,
PARTITION p20150928 VALUES LESS THAN (736235) ENGINE = InnoDB,
PARTITION p20150929 VALUES LESS THAN (736236) ENGINE = InnoDB,
PARTITION p20150930 VALUES LESS THAN (736237) ENGINE = InnoDB,
PARTITION p20151001 VALUES LESS THAN (736238) ENGINE = InnoDB,
PARTITION p20151002 VALUES LESS THAN (736239) ENGINE = InnoDB,
PARTITION p20151003 VALUES LESS THAN (736240) ENGINE = InnoDB,
PARTITION p20151004 VALUES LESS THAN (736241) ENGINE = InnoDB,
PARTITION p20151005 VALUES LESS THAN (736242) ENGINE = InnoDB,
PARTITION p20151006 VALUES LESS THAN (736243) ENGINE = InnoDB,
PARTITION p20151007 VALUES LESS THAN (736244) ENGINE = InnoDB,
PARTITION p20151008 VALUES LESS THAN (736245) ENGINE = InnoDB,
PARTITION p20151009 VALUES LESS THAN (736246) ENGINE = InnoDB,
PARTITION p20151010 VALUES LESS THAN (736247) ENGINE = InnoDB,
PARTITION p20151011 VALUES LESS THAN (736248) ENGINE = InnoDB,
PARTITION p20151012 VALUES LESS THAN (736249) ENGINE = InnoDB,
PARTITION p20151013 VALUES LESS THAN (736250) ENGINE = InnoDB,
PARTITION p20151014 VALUES LESS THAN (736251) ENGINE = InnoDB,
PARTITION p20151015 VALUES LESS THAN (736252) ENGINE = InnoDB,
PARTITION p20151016 VALUES LESS THAN (736253) ENGINE = InnoDB,
PARTITION p20151017 VALUES LESS THAN (736254) ENGINE = InnoDB,
PARTITION p20151018 VALUES LESS THAN (736255) ENGINE = InnoDB,
PARTITION p20151019 VALUES LESS THAN (736256) ENGINE = InnoDB,
PARTITION p20151020 VALUES LESS THAN (736257) ENGINE = InnoDB,
PARTITION p20151021 VALUES LESS THAN (736258) ENGINE = InnoDB,
PARTITION p20151022 VALUES LESS THAN (736259) ENGINE = InnoDB,
PARTITION p20151023 VALUES LESS THAN (736260) ENGINE = InnoDB,
PARTITION p20151024 VALUES LESS THAN (736261) ENGINE = InnoDB,
PARTITION p20151025 VALUES LESS THAN (736262) ENGINE = InnoDB,
PARTITION p20151026 VALUES LESS THAN (736263) ENGINE = InnoDB,
PARTITION p20151027 VALUES LESS THAN (736264) ENGINE = InnoDB,
PARTITION p20151028 VALUES LESS THAN (736265) ENGINE = InnoDB,
PARTITION p20151029 VALUES LESS THAN (736266) ENGINE = InnoDB,
PARTITION p20151030 VALUES LESS THAN (736267) ENGINE = InnoDB,
PARTITION p20151031 VALUES LESS THAN (736268) ENGINE = InnoDB,
PARTITION p20151101 VALUES LESS THAN (736269) ENGINE = InnoDB,
PARTITION p20151102 VALUES LESS THAN (736270) ENGINE = InnoDB,
PARTITION p20151103 VALUES LESS THAN (736271) ENGINE = InnoDB,
PARTITION p20151104 VALUES LESS THAN (736272) ENGINE = InnoDB,
PARTITION p20151105 VALUES LESS THAN (736273) ENGINE = InnoDB,
PARTITION p20151106 VALUES LESS THAN (736274) ENGINE = InnoDB,
PARTITION p20151107 VALUES LESS THAN (736275) ENGINE = InnoDB,
PARTITION p20151108 VALUES LESS THAN (736276) ENGINE = InnoDB,
PARTITION p20151109 VALUES LESS THAN (736277) ENGINE = InnoDB,
PARTITION p20151110 VALUES LESS THAN (736278) ENGINE = InnoDB,
PARTITION p20151111 VALUES LESS THAN (736279) ENGINE = InnoDB,
PARTITION p20151112 VALUES LESS THAN (736280) ENGINE = InnoDB,
PARTITION p20151113 VALUES LESS THAN (736281) ENGINE = InnoDB,
PARTITION p20151114 VALUES LESS THAN (736282) ENGINE = InnoDB,
PARTITION p20151115 VALUES LESS THAN (736283) ENGINE = InnoDB,
PARTITION p20151116 VALUES LESS THAN (736284) ENGINE = InnoDB,
PARTITION p20151117 VALUES LESS THAN (736285) ENGINE = InnoDB,
PARTITION p20151118 VALUES LESS THAN (736286) ENGINE = InnoDB,
PARTITION p20151119 VALUES LESS THAN (736287) ENGINE = InnoDB,
PARTITION p20151120 VALUES LESS THAN (736288) ENGINE = InnoDB,
PARTITION p20151121 VALUES LESS THAN (736289) ENGINE = InnoDB,
PARTITION p20151122 VALUES LESS THAN (736290) ENGINE = InnoDB,
PARTITION p20151123 VALUES LESS THAN (736291) ENGINE = InnoDB,
PARTITION p20151124 VALUES LESS THAN (736292) ENGINE = InnoDB,
PARTITION p20151125 VALUES LESS THAN (736293) ENGINE = InnoDB,
PARTITION p20151126 VALUES LESS THAN (736294) ENGINE = InnoDB,
PARTITION p20151127 VALUES LESS THAN (736295) ENGINE = InnoDB,
PARTITION p20151128 VALUES LESS THAN (736296) ENGINE = InnoDB,
PARTITION p20151129 VALUES LESS THAN (736297) ENGINE = InnoDB,
PARTITION p20151130 VALUES LESS THAN (736298) ENGINE = InnoDB,
PARTITION p20151201 VALUES LESS THAN (736299) ENGINE = InnoDB,
PARTITION p20151202 VALUES LESS THAN (736300) ENGINE = InnoDB,
PARTITION p20151203 VALUES LESS THAN (736301) ENGINE = InnoDB,
PARTITION p20151204 VALUES LESS THAN (736302) ENGINE = InnoDB,
PARTITION p20151205 VALUES LESS THAN (736303) ENGINE = InnoDB,
PARTITION p20151206 VALUES LESS THAN (736304) ENGINE = InnoDB,
PARTITION p20151207 VALUES LESS THAN (736305) ENGINE = InnoDB,
PARTITION p20151208 VALUES LESS THAN (736306) ENGINE = InnoDB,
PARTITION p20151209 VALUES LESS THAN (736307) ENGINE = InnoDB,
PARTITION p20151210 VALUES LESS THAN (736308) ENGINE = InnoDB,
PARTITION p20151211 VALUES LESS THAN (736309) ENGINE = InnoDB,
PARTITION p20151212 VALUES LESS THAN (736310) ENGINE = InnoDB,
PARTITION p20151213 VALUES LESS THAN (736311) ENGINE = InnoDB,
PARTITION p20151214 VALUES LESS THAN (736312) ENGINE = InnoDB,
PARTITION p20151215 VALUES LESS THAN (736313) ENGINE = InnoDB,
PARTITION p20151216 VALUES LESS THAN (736314) ENGINE = InnoDB,
PARTITION p20151217 VALUES LESS THAN (736315) ENGINE = InnoDB,
PARTITION p20151218 VALUES LESS THAN (736316) ENGINE = InnoDB,
PARTITION p20151219 VALUES LESS THAN (736317) ENGINE = InnoDB,
PARTITION p20151220 VALUES LESS THAN (736318) ENGINE = InnoDB,
PARTITION p20151221 VALUES LESS THAN (736319) ENGINE = InnoDB,
PARTITION p20151222 VALUES LESS THAN (736320) ENGINE = InnoDB,
PARTITION p20151223 VALUES LESS THAN (736321) ENGINE = InnoDB,
PARTITION p20151224 VALUES LESS THAN (736322) ENGINE = InnoDB,
PARTITION p20151225 VALUES LESS THAN (736323) ENGINE = InnoDB,
PARTITION p20151226 VALUES LESS THAN (736324) ENGINE = InnoDB,
PARTITION p20151227 VALUES LESS THAN (736325) ENGINE = InnoDB,
PARTITION p20151228 VALUES LESS THAN (736326) ENGINE = InnoDB,
PARTITION p20151229 VALUES LESS THAN (736327) ENGINE = InnoDB,
PARTITION p20151230 VALUES LESS THAN (736328) ENGINE = InnoDB,
PARTITION p20151231 VALUES LESS THAN (736329) ENGINE = InnoDB) */
1 row in set (0.00 sec)
ERROR:
No query specified
mysql> insert into ClientActionTrack values(302753,302753,'1.1.1.1','http','a','a','a','a','a','2016-11-13 11:59:59','2015-11-25 12:00:00');
ERROR 1526 (HY000): Table has no partition for value 736646
mysql> insert into ClientActionTrack values(302753,302753,'1.1.1.1','http','a','a','a','a','a','2016-11-13 11:59:59','2015-11-25 12:00:00');
ERROR 1526 (HY000): Table has no partition for value 736646
mysql> alter table ClientActionTrack add partition (partition pmax values less than (MAXVALUE);
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
mysql> alter table ClientActionTrack add partition (partition pmax values less than (MAXVALUE));
Query OK, 0 rows affected (1.31 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> insert into ClientActionTrack values(302753,302753,'1.1.1.1','http','a','a','a','a','a','2016-11-13 11:59:59','2015-11-25 12:00:00');
Query OK, 1 row affected (0.25 sec)
mysql> select * from ClientActionTrack partition (pmax);
+--------+----------+---------+------+------------+---------------+---------------+---------+-----------+---------------------+---------------------+
| sn | clientSn | ip | url | httpMethod | requestParams | requestHeader | pageUrl | sessionId | startTime | completeTime |
+--------+----------+---------+------+------------+---------------+---------------+---------+-----------+---------------------+---------------------+
| 302753 | 302753 | 1.1.1.1 | http | a | a | a | a | a | 2016-11-13 11:59:59 | 2015-11-25 12:00:00 |
+--------+----------+---------+------+------------+---------------+---------------+---------+-----------+---------------------+---------------------+
1 row in set (0.00 sec)
mysql pmax 分区
最新推荐文章于 2023-09-11 09:22:03 发布