MySQL Forums
Forum List  »  Partitioning

Partitioning Problem
Posted by: sireesh beemineni
Date: April 09, 2010 07:07AM

My table structure is give below

CREATE TABLE IF NOT EXISTS `employee` (
`emp_id` int(11) NOT NULL AUTO_INCREMENT,
`emp_name` varchar(20) NOT NULL,
`emp_sal` int(8) NOT NULL,
`emp_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE KEY `emp_id` (`emp_id`)
) ENGINE=MyISAM ;

i want to partition the table by emp_date wise.
So that i write the below query to do that task.

ALTER TABLE employee PARTITION BY RANGE (UNIX_TIMESTAMP(emp_date)) (
PARTITION P0 VALUES LESS THAN (1136073600),
PARTITION P1 VALUES LESS THAN (1167609600),
PARTITION P2 VALUES LESS THAN (1199145600),
PARTITION P3 VALUES LESS THAN (1230768000),
PARTITION P4 VALUES LESS THAN (1262304000 ),
PARTITION P8 VALUES LESS THAN (MAXVALUE)
);

If I run this query i am gettin the Error.
#1503 - A PRIMARY KEY must include all columns in the table's partitioning function


Please help me in this aspect.

Options: ReplyQuote


Subject
Views
Written By
Posted
Partitioning Problem
3554
April 09, 2010 07:07AM
1759
April 11, 2010 10:46PM


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.