Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am a newbie into partition. First I have a table with auto increment with its primary key and many other fields. I wanted to partition based on dataInsertDateTime column. It have me error so I had to rebuild the primary inclusive of the dataID and dataInsertDateTime which I think is correct step. I just tried like below scripts. How to verify if my partition is being build accordingly? I tried explain a query with the dataInsertTime<'2012-12-11' is showing me both p0 and p1. Kind of confuse here.

ALTER TABLE tblData PARTITION BY RANGE (to_days(`dataInsertDateTime`)) (
PARTITION p0 VALUES LESS THAN (to_days('2012-12-10')),
PARTITION p1 VALUES LESS THAN (to_days('2012-12-11')) )
share|improve this question
dataInsertTime<'2012-12-11' ranges over both those partitions. Try dataInsertTime>='2012-12-11' – Mat Dec 9 '12 at 18:10
@mat just a side track are my procedures for the partition is correct? why must I set the po less than how if I need exactly for the day how to work it out? – newbie14 Dec 10 '12 at 1:53

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.