MySQL Forums
Forum List  »  Partitioning

Re: Partition With out use Primary Key
Posted by: Jonathan Stephens
Date: August 22, 2006 07:14AM

Actually, part of what I said in #3 appears to be wrong, as the following statement fails:

mysql> CREATE TABLE t1 (
-> col1 INT NOT NULL,
-> col2 DATE NOT NULL,
-> col3 INT NOT NULL,
-> col4 INT NOT NULL,
-> PRIMARY KEY(col3),
-> UNIQUE KEY(col1, col2)
-> )
-> PARTITION BY HASH(col3)
-> PARTITIONS 4;
ERROR 1490 (HY000): A UNIQUE INDEX need to include all fields in the partition function

I was under the impression that, if a table had a PK, then UKs didn't matter with regard to the partitioning expression, but this is not the case. My bad.

Jon Stephens
MySQL Documentation Team @ Oracle
Orlando, Florida, USA

MySQL Dev Zone
MySQL Server Documentation
Oracle

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Partition With out use Primary Key
4068
August 22, 2006 07:14AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.