MySQL Forums
Forum List  »  Partitioning

Re: Suggestion?
Posted by: Mikael Ronström
Date: May 27, 2006 01:30PM

Hi,

fz wsc wrote:
> Now, to be a partition key, a column has to be
> included in PRIMARY KEY().

It's perfectly reasonable that this should not be a requirement. However
in 5.1 we don't support global indexes for partitioning and thus it would
not be scalable to ensure uniqueness constraint by checking in all partitions
for each insert done into the table. So most likely this constraint will
disappear in later MySQL versions, most likely at the same time as we
support global indexes.

Rgrds Mikael


> For instance, in the following statement, I don't
> really want `p1` be included in the PRIMARY KEY.
> Is this suggestion reasonable?
>
> CREATE TABLE `t1` (
> `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
> `p1` varchar(50) NOT NULL,
> PRIMARY KEY (`id`,`p1`)
> ) ENGINE=InnoDB DEFAULT CHARSET=utf8
> ROW_FORMAT=DYNAMIC AUTO_INCREMENT=1
> COLLATE utf8_general_ci
> PARTITION BY LINEAR KEY(`p1`)
> PARTITIONS 4;

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Suggestion?
2074
May 27, 2006 01:30PM


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.