MySQL Forums
Forum List  »  Partitioning

Re: Partioning a table with a big index, does it help?
Posted by: Scott Noyes
Date: October 08, 2008 09:04AM

> I believe you'd have to make a primary key in
> order to partition the data (even if it's all 3
> keys), because of how partitioning currently works
> - the partitioned key needs to be part of the
> primary key.

At the moment (5.1.28), partitioning doesn't require any primary key on the table, but if you do have a primary or unique key, it must contain any columns used in the partitioning expression.

This is legal:
CREATE TABLE t1 (id int, d int) PARTITION BY RANGE(d)...

This is not legal:
CREATE TABLE t1 (id int, d int, PRIMARY KEY (id)) PARTITION BY RANGE(d)...

This makes it legal again:
CREATE TABLE t1 (id int, d int, PRIMARY KEY (id, d)) PARTITION BY RANGE(d)...

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Partioning a table with a big index, does it help?
2547
October 08, 2008 09:04AM


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.