Pop quiz. Look at the picture below. Quick: can you tell me to
which year and month partition P001 refers?
I couldn't say it without asking the database itself to revert
the output of to_days:
select from_days(723180);
+-------------------+
| from_days(723180) |
+-------------------+
| 1980-01-01 |
+-------------------+
Just to make the pain more clear, you do something like this,
clean and neat, and you think you have done a good job.
CREATE TABLE t1 ( d DATE )
PARTITION by range (to_days(d))
(
partition p001 VALUES LESS THAN (to_days('2001-01-01'))
, partition p002 VALUES LESS THAN (to_days('2001-02-01'))
, partition p003 VALUES LESS THAN …
[Read more]