MySQL Forums
Forum List  »  Partitioning

Add new partition for Range by date
Posted by: Mannoj Kumar
Date: August 09, 2012 04:05AM

Hi Folks,

Below is the actual partitioned table.

CREATE TABLE `idea_partition` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`mdn` varchar(45) NOT NULL,
`keyword` varchar(45) NOT NULL,
`circle` varchar(45) DEFAULT NULL,
`status` varchar(45) NOT NULL,
`mode` varchar(25) DEFAULT NULL,
`action` varchar(45) DEFAULT NULL,
`mobile_type` varchar(45) DEFAULT NULL,
`date` datetime NOT NULL,
`sunsign` varchar(45) DEFAULT NULL,
`numerology` int(10) unsigned DEFAULT NULL,
`unsubdate` datetime DEFAULT NULL,
`user` varchar(15) DEFAULT NULL,
`pass` varchar(15) DEFAULT NULL,
`refid` varchar(64) DEFAULT NULL,
`info` varchar(128) DEFAULT NULL,
`precharge` varchar(1) DEFAULT NULL,
`originator` varchar(15) DEFAULT NULL,
`price` double(6,2) DEFAULT NULL,
`renewal_count` int(11) DEFAULT '1',
PRIMARY KEY (`id`,`date`),
UNIQUE KEY `Index_on_mdn_keyword_status` (`mdn`,`keyword`,`status`,`date`),
KEY `Index_2` (`mdn`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
PARTITION BY RANGE( TO_DAYS(date) ) (
PARTITION rx201201 VALUES LESS THAN( TO_DAYS('2012-01-01 00:00:00') ),
PARTITION rx201202 VALUES LESS THAN( TO_DAYS('2012-02-01 00:00:00') ),
PARTITION rx201203 VALUES LESS THAN( TO_DAYS('2012-03-01 00:00:00') ),
PARTITION rx201204 VALUES LESS THAN( TO_DAYS('2012-04-01 00:00:00') ),
PARTITION rx201205 VALUES LESS THAN( TO_DAYS('2012-05-01 00:00:00') ),
PARTITION rx201206 VALUES LESS THAN( TO_DAYS('2012-06-01 00:00:00') ),
PARTITION rx201207 VALUES LESS THAN( TO_DAYS('2012-07-01 00:00:00') ),
PARTITION rx201208 VALUES LESS THAN( TO_DAYS('2012-08-01 00:00:00') ),
PARTITION rx201209 VALUES LESS THAN( TO_DAYS('2012-09-01 00:00:00') ),
PARTITION rxMORES VALUES LESS THAN (MAXVALUE) );


Is it possible to add new partition on an existing range by partition on a date column. Like below -

ALTER TABLE idea_partition partition (TO_DAYS(date)) partition rx201301 VALUES LESS THAN (TO_DAYS('2013-01-01 00:00:00');

It threw me error ..!! But if there is a way to achieve it?

Options: ReplyQuote


Subject
Views
Written By
Posted
Add new partition for Range by date
2788
August 09, 2012 04:05AM


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.