MySQL Forums
Forum List  »  Partitioning

Re: Prunning partitions with range by date (SOLVED)
Posted by: Diogo Domanski
Date: September 27, 2012 03:00PM

Thanks Aftab. Your solution worked perfectly. Problem solved. The new CREATE TABLE statement is:

CREATE TABLE `test` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`ins_date` datetime NOT NULL,
PRIMARY KEY (`id`, `ins_date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8
PARTITION BY RANGE COLUMNS (`ins_date`) (
PARTITION pre_year VALUES LESS THAN ('2012-01-01'),
PARTITION cur_year_jan VALUES LESS THAN ('2012-02-01'),
PARTITION cur_year_feb VALUES LESS THAN ('2012-03-01'),
PARTITION cur_year_mar VALUES LESS THAN ('2012-04-01'),
PARTITION cur_year_may VALUES LESS THAN ('2012-05-01'),
PARTITION cur_year_apr VALUES LESS THAN ('2012-06-01'),
PARTITION cur_year_jun VALUES LESS THAN ('2012-07-01'),
PARTITION cur_year_jul VALUES LESS THAN ('2012-08-01'),
PARTITION cur_year_aug VALUES LESS THAN ('2012-09-01'),
PARTITION cur_year_sep VALUES LESS THAN ('2012-10-01'),
PARTITION cur_year_oct VALUES LESS THAN ('2012-11-01'),
PARTITION cur_year_nov VALUES LESS THAN ('2012-12-01'),
PARTITION cur_year_dec VALUES LESS THAN ('2013-01-01'),
PARTITION nex_year VALUES LESS THAN (MAXVALUE)
);



Edited 2 time(s). Last edit at 11/29/2012 01:06PM by Diogo Domanski.

Options: ReplyQuote


Subject
Views
Written By
Posted
2924
September 27, 2012 01:18PM
1769
September 27, 2012 01:39PM
Re: Prunning partitions with range by date (SOLVED)
1586
September 27, 2012 03:00PM


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.