MYSQL5.5表分区问题_MySQL

WBOY
发布: 2016-06-01 13:32:06
原创
1743 人浏览过

bitsCN.com

MYSQL5.5表分区问题

 

1.字段属性为timestamp,在分区时出现异常

 

Constant, random or timezone-dependent expressions in (sub)partitioning function are not allowed

 

网上找了下好像是说timestamp类型分区时不起作用要改成DATETIME or DATE

 

pruning is not expected to work for tables partitioned on a TIMESTAMP column, and you should use a DATETIME or DATE column for this instead.

 

2.修改为datetime后出现错误提示如下

 

A PRIMARY KEY must include all columns in the table's partitioning function

 

mysql分区字段必须包含在主键中

 

sql如下:

 

ALTER TABLE Test  PARTITION BY LIST (dayofweek(time))  (    PARTITION p01 VALUES IN (1),  PARTITION p02 VALUES IN (2),  PARTITION p03 VALUES IN (3),  PARTITION p04 VALUES IN (4),  PARTITION p05 VALUES IN (5),  PARTITION p06 VALUES IN (6),  PARTITION p07 VALUES IN (7),  PARTITION perr VALUES IN (0)); 
登录后复制

 

 

bitsCN.com
相关标签:
来源:php.cn
本站声明
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板