MySQL 2 Subpartition
I have table with 3 columns in MySQL, and I have partition on year and sub-partition on month
CREATE TABLE report (
id BIGINT NOT NULL AUTO_INCREMENT,
impressions INT UNSIGNED,
created_at date NOT NULL,
PRIMARY KEY (id, created_at)
)
PARTITION BY RANGE( YEAR(created_at) )
SUBPARTITION BY HASH( MONTH(created_at) )
SUBPARTITIONS 12 (
PARTITION y0 VALUES LESS THAN (2018),
PARTITION y1 VALUES LESS THAN (2019),
PARTITION y2 VALUES LESS THAN (2020),
PARTITION y3 VALUES LESS THAN (2021),
PARTITION y4 VALUES LESS THAN MAXVALUE
);
I'm trying to one more sub-partition on days. I want to make it like below.
Parent partition: Years(y0, y1, y2, y3)
Sub-partition of years: Month(m1, m2, m3, m4, m5, ..., m10, m11, m12)
Sub-partition of months: Day(d1, d2, d3, d4, d5, d6, d7, ....., d30, d31)
Is this possible ?