MySQL Forums
Forum List  »  Partitioning

Re: Bug or wrong syntax? Partitioning tables with primary keys AND unique indexes (err: #1482)
Posted by: Mikael Ronström
Date: April 21, 2006 01:13PM

The only storage engine that supports this feature is NDB Cluster.
In order to support unique indexes that have fields outside of the
partition function we need to support "Global indexes" and this is
not supported by partitioning in 5.1 (only using unique indexes for
NDB).

So it's a lacking feature of partitioning in 5.1, will arrive in a
later version.

Rgrds Mikael

Brian Lucas wrote:
> I'm attempting to partition a table by primary
> key. This table also contains a unique index
> which is seperate from the primary key as well.
>
> When attempting to partition, I get the following
> error:
>
> -------
> ALTER TABLE urls PARTITION BY RANGE(id)(
> PARTITION p0 VALUES LESS THAN( 200000 )
> ...
> )
>
> ERROR:
> #1481 - A UNIQUE INDEX need to include all fields
> in the partition function
> --------
>
> However, if I convert the unique index to regular
> index, I can partition the table just fine.
>
> Attempting to convert the index back to unique
> results in the following error:
>
> ALTER TABLE `urls` DROP INDEX `hash` ,
> ADD UNIQUE `hash` ( `canon` ( 24 ) , `path` ( 24 )
> )
>
> MySQL said: Documentation
> #1481 - A UNIQUE INDEX need to include all fields
> in the partition function
>
> How do I partition a table by a primary key and
> still make it have a unique index as well?
>
>
>
> Edited 1 times. Last edit at 04/20/06 07:24PM by
> Brian Lucas.

Options: ReplyQuote


Subject
Views
Written By
Posted
Re: Bug or wrong syntax? Partitioning tables with primary keys AND unique indexes (err: #1482)
2141
April 21, 2006 01:13PM


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.