ERROR 1503 (HY000): A PRIMARY KEY must include all columns in the table's partitioning function
来源:互联网 发布:数组长度是什么 编辑:程序博客网 时间:2024/05/20 11:50
在创建分区表时,mysql报了这样一个错误。
ERROR 1503 (HY000): A PRIMARY KEY must include all columns in the table's partitioning function
大意是用于做分区表的列必须是主键,或包含于主键中。
明白原因后就好处理了,把用于分区的列也加入到主键中,形成复合主键,然后再执行。
CREATE TABLE `f_res` ( `id` int(10) unsigned NOT NULL AUTO_INCREMENT, `eid` int(10) unsigned NOT NULL DEFAULT '0', `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, PRIMARY KEY (`id`,`eid`), KEY `idx_eid` (`eid`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 partition by hash(eid) partitions 10;
这样就可以执行成功了。
注意:在做分区表时,选择分区的依据字段时要谨慎,需要仔细斟酌这个字段拿来做为分区依据是否合适,这个字段加入到主键中做为复合主键是否适合。
阅读全文
0 0
- ERROR 1503 (HY000): A PRIMARY KEY must include all columns in the table's partitioning function
- MySQL 表分区 A PRIMARY KEY must include all columns in the table's partitioning function
- phoenix create table Order of columns in primary key constraint must match the order in which they'r
- ORA-14039: partitioning columns must form a subset of key columns of a UNIQUE index
- ORA-14039: partitioning columns must form a subset of key columns of a UNIQUE index SYS
- Nhibernate: Foreign key must have same number of columns as the referenced primary key
- PostgreSQL special sql 1 - list all the columns and primary key
- Hide the columns in table-control
- CoreData: error: (19) PRIMARY KEY must be unique
- 168.You execute this command to drop the ITEM table, which has the primary key referred in the ORDER
- Caused by: android.view.InflateException: You must specifiy a layout in the include tag: <include la
- You must specifiy a layout in the include tag: <include layout="@layout/layoutID" />
- Caused by: android.view.InflateException: You must specifiy a layout in the include tag: <include la
- LOV for Editable Primary Key in ADF Table Problem
- TypeError: view must be a callable or a list/tuple in the case of include()
- TypeError: view must be a callable or a list/tuple in the case of include().
- TypeError: view must be a callable or a list/tuple in the case of include().解决办法
- TypeError: view must be a callable or a list/tuple in the case of include()
- Ubuntu下git本地仓库与远程仓库的同步
- Unity Shader 学习笔记(1) DrawCall
- Javascript E-mail验证
- 写入日志到文本文件
- 1004. 成绩排名 (20)——C语言
- ERROR 1503 (HY000): A PRIMARY KEY must include all columns in the table's partitioning function
- 坐标反查
- 【送书福利】第一次送书活动(总共10本)
- 欢迎使用CSDN-markdown编辑器
- LODOP打印控件实现设计并且代码生成
- Angular JS 之对表格进行操作
- MQTT协议简记
- Oracle:简单分析火车票余票查询和座位剩余
- Mangos源码分析(11):服务器公共组件实现之状态机