MySQL Forums
Forum List  »  Partitioning

Modify primary key for partitioning
Posted by: Aurelien PANIZZA
Date: August 10, 2012 10:29AM


I want to use range partitioning for a table. Currently, this table has a primary key based on one column (not an auto-increment, but a unique varchar). In order to create the partitioning, I must add the column (datetime) I want to partition on, to the primary key. Therefore, the primary key will be less restrictive (I can have twice the same varchar if the datetime is different). A solution is to enforce a unique key on the varchar column, so that I can't get twice the same value. I'm just wondering if it's a good idea to have a column once in the primary key plus an unique index on it (mainly for the performance). What do you think of this design ? Do you have any better suggestion ?


Edited 1 time(s). Last edit at 08/11/2012 04:22AM by Aurelien PANIZZA.

Options: ReplyQuote

Written By
Modify primary key for partitioning
August 10, 2012 10:29AM

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.