MySQL Forums :: Partitioning :: No other way than delete primary key to create partitions by single datetime columns?


Advanced Search

No other way than delete primary key to create partitions by single datetime columns?
Posted by: Sam Young ()
Date: August 20, 2015 08:00PM

Hi, I have a question, the table like this

CREATE TABLE `t1` (
`id` varchar(64) NOT NULL,
`createDate` datetime DEFAULT NULL,
`col3` int(11) DEFAULT NULL,
`col4` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

The table is so huge that I want partition it by `createDate` column to have a better select performance.

Partition like this:

ALTER TABLE t1 PARTITION BY RANGE COLUMNS (createDate)(
PARTITION p2015_6_1 VALUES less than ('2015-6-1'),
PARTITION p2015_7_1 VALUES less than ('2015-7-1'),
PARTITION pmax VALUES LESS THAN (MAXVALUE)
);

Is this no other way than delete primary key ?
Or some trick usage that partition it by a range column and keep the primary key ?

Options: ReplyQuote


Subject Views Written By Posted
No other way than delete primary key to create partitions by single datetime columns? 1280 Sam Young 08/20/2015 08:00PM
Re: No other way than delete primary key to create partitions by single datetime columns? 795 Jonathan Stephens 08/21/2015 02:53AM
Re: No other way than delete primary key to create partitions by single datetime columns? 705 Sam Young 08/23/2015 08:57PM
Re: No other way than delete primary key to create partitions by single datetime columns? 691 Rick James 08/22/2015 03:35PM
Re: No other way than delete primary key to create partitions by single datetime columns? 647 Sam Young 08/23/2015 09:23PM
Re: No other way than delete primary key to create partitions by single datetime columns? 618 Rick James 08/24/2015 12:36PM
Re: No other way than delete primary key to create partitions by single datetime columns? 690 Sam Young 08/26/2015 12:53AM
Re: No other way than delete primary key to create partitions by single datetime columns? 688 Rick James 08/26/2015 10:02AM
Re: No other way than delete primary key to create partitions by single datetime columns? 646 Sam Young 08/26/2015 07:42PM


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.