I created a table to log the activity of my application. This table will log more than 2 millions record per month. So I want to use partitioning by month or week
CREATE TABLE IF NOT EXISTS `UL`.`Log` (
`LogID` INT(20) NOT NULL AUTO_INCREMENT,
`LogDate` DATETIME NULL,
`AssessorName` VARCHAR(255) NULL
PRIMARY KEY (`LogID`),
INDEX `AssessorName` (`AssessorName`),
INDEX `LogDate` (`LogDate`)
)
ENGINE = INNODB;
But the problem is I have to create the partitioning manually such as
PARTITION BY RANGE (EXTRACT(YEAR_MONTH FROM LogDate)) (
PARTITION pre_2014 VALUES LESS THAN (201400),
PARTITION jan_2014 VALUES LESS THAN (201401),
PARTITION feb_2014 VALUES LESS THAN (201402),
....
Is the any way to create a partition by month or week automatically?
Thanks