MySQL Forums
Forum List  »  Partitioning

Re: Partitioning and PK
Posted by: Scott Noyes
Date: October 08, 2008 09:00AM

Erhan,

I think the limitation you're running into is that the primary or unique key must contain any columns used in the partition expression. Hence this is illegal:

CREATE TABLE t1 (id int, d date, PRIMARY KEY (id)) PARTITION BY RANGE(YEAR(d));

But this makes it legal:

CREATE TABLE t1 (id int, d date, PRIMARY KEY (id, d)) PARTITION BY RANGE(YEAR(d));

Options: Reply• Quote


Subject
Views
Written By
Posted
4104
July 11, 2008 02:54PM
2632
August 02, 2008 10:14AM
Re: Partitioning and PK
2545
October 08, 2008 09:00AM


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.