SQL表分区产生Alter Table错误

时间:2019-06-24 09:20:46

标签: mysql laravel phpmyadmin

我有一个包含数百万条记录的数据库表。为了优化查询,我想根据州(即美国)对表进行分区。 但是,当我在sql部分执行alter table代码时,提示我错误。

我已经根据“ ST”列对表进行了分区。

ALTER TABLE data_managements PARTITION BY LIST COLUMNS (ST)
(
PARTITION AL VALUES IN ('AL'),
PARTITION AK VALUES IN ('AK'),
PARTITION AZ VALUES IN ('AZ'),
PARTITION AR VALUES IN ('AR'),
PARTITION CA VALUES IN ('CA'),
PARTITION CO VALUES IN ('CO'),
PARTITION CT VALUES IN ('CT'),
PARTITION DE VALUES IN ('DE'),
PARTITION FL VALUES IN ('FL'),
PARTITION GA VALUES IN ('GA'),
PARTITION HI VALUES IN ('HI'),
PARTITION ID VALUES IN ('ID'),
PARTITION IL VALUES IN ('IL'),
PARTITION `IN` VALUES IN ('IN'),
PARTITION IA VALUES IN ('IA'),
PARTITION KS VALUES IN ('KS'),
PARTITION KY VALUES IN ('KY'),
PARTITION LA VALUES IN ('LA'),
PARTITION ME VALUES IN ('ME'),
PARTITION MD VALUES IN ('MD'),
PARTITION MA VALUES IN ('MA'),
PARTITION MI VALUES IN ('MI'),
PARTITION MN VALUES IN ('MN'),
PARTITION MS VALUES IN ('MS'),
PARTITION MO VALUES IN ('MO'),
PARTITION MT VALUES IN ('MT'),
PARTITION NE VALUES IN ('NE'),
PARTITION NV VALUES IN ('NV'),
PARTITION NH VALUES IN ('NH'),
PARTITION NJ VALUES IN ('NJ'),
PARTITION NM VALUES IN ('NM'),
PARTITION NY VALUES IN ('NY'),
PARTITION NC VALUES IN ('NC'),
PARTITION ND VALUES IN ('ND'),
PARTITION OH VALUES IN ('OH'),
PARTITION OK VALUES IN ('OK'),
PARTITION `OR` VALUES IN ('OR'),
PARTITION PA VALUES IN ('PA'),
PARTITION RI VALUES IN ('RI'),
PARTITION SC VALUES IN ('SC'),
PARTITION SD VALUES IN ('SD'),
PARTITION TN VALUES IN ('TN'),
PARTITION TX VALUES IN ('TX'),
PARTITION UT VALUES IN ('UT'),
PARTITION VT VALUES IN ('VT'),
PARTITION VA VALUES IN ('VA'),
PARTITION WA VALUES IN ('WA'),
PARTITION WV VALUES IN ('WV'),
PARTITION WI VALUES IN ('WI'),
PARTITION WY VALUES IN ('WY')
);

系统应根据要求创建上述分区,但提示我两个错误:

* Missing comma before start of a new alter operation. (near "PARTITION" at position 64)
* Unrecognized alter operation. (near "PARTITION" at position 64)

如果有人可以指导我解决此问题,我将不胜感激。 谢谢,

0 个答案:

没有答案