I have the following table setup (column names simplified for the example):
CREATE TABLE data_2016
( `a` INTEGER ,
`b` INTEGER,
`c` VARCHAR(255),
`d` BIGINT,
`e` VARCHAR(255) NOT NULL,
`f` INTEGER ,
`g` BIGINT ,
`h` BIGINT ,
`i` SERIAL,
PRIMARY KEY (`d`,`i`),
UNIQUE KEY(`b`, `c`, `d`, `e`, `f`,`g`,`h`,`i`),
INDEX `idx1` (`b`,`c`)
)
PARTITION BY RANGE (`d`) (
PARTITION p1 VALUES LESS THAN (...)
...
PARTITION px VALUES LESS THAN (MAXVALUE)
)
But I am getting the exception A UNIQUE INDEX must include all columns in the table's partitioning function
I read through the documentation, and from what I can tell, I do have the correct setup. The partitioned column d is included in both the PRIMARY KEY and the UNIQUE KEY definition. What am I doing wrong here?
icolumn.icolumn? I'm not partitioning on it. Is it saying I need to include it in the partition?PARTITIONing? It rarely provides any performance benefit. (I can't guess at the answer because of the obfuscation.)