MySQL Forums
Forum List  »  Partitioning

Does Mysql Date Partition can be created on date time for every day???
Posted by: Akshath Hegde
Date: August 23, 2015 12:18AM

Hi,
I want row table in mysql with date partition.

My date partition requirement as follows :

1. Date partition must be on each date.
Ex : If i have one year records in table Number of partition must be 366/365. If i want to keep same partition for 2 year then number partition will be 366+366.

2. i don't want to write 366/365 date partition statement while creating table.

* When i gone through mysql partition document, it suggest create partition we have to specify each date.

* Is there a way to create tables by partition in single statement

Something like this (this creation example is from other database structure) :
CREATE TABLE TEST_TABLE (
CDR_ID int,
DATETIME_VAL datetime NOT NULL,
) PARTITION BY (EXTRACT(YEAR FROM DATETIME_VAL)*100 + EXTRACT(MONTH FROM DATETIME_VAL))*100+ EXTRACT(DAY FROM DATETIME_VAL);

3. If i use MYSQL list partition whether it will help?? is there any restriction on number of partition on table?

Ex : CREATE TABLE TEST_TABLE (
CDR_ID int,
DATETIME_VAL datetime NOT NULL,
)PARTITION BY KEY(DATE(DATETIME_VAL))
PARTITIONS 366;


Is this possible in MYSQL?

Note : I have gone through mysql partition concepts. Please suggest suitable partition for above scenario.

Thanks,
Akshath

Options: ReplyQuote


Subject
Views
Written By
Posted
Does Mysql Date Partition can be created on date time for every day???
4638
August 23, 2015 12:18AM


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.