MySQL Forums
Forum List  »  Partitioning

Re: How to ensure uniqueness of one column but partition by another key?
Posted by: Phil Hildebrand
Date: March 19, 2008 08:49PM

Just add platTime to your primary key:

create table tp
(
id varchar(32) not null default '',
platTime datetime not null default '1000-01-01 00:00:00',
primary key (id,platTime)
)
type = InnoDB
PARTITION BY RANGE ( YEAR(platTime))
(PARTITION p0 VALUES LESS THAN (X),
PARTITION p1 VALUES LESS THAN (Y),
PARTITION p3 VALUES LESS THAN MAXVALUE)

Options: ReplyQuote




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.