MySQL Forums
Forum List  »  Partitioning

Help to alter a non partitioned table to partitioned with subpartitions
Posted by: Oliver C
Date: August 28, 2020 05:04AM

Hi,

I have a table in my MySQL 5.7 database:

create table CUSTOMERS
(
CUSTOMER_ID bigint not null,
SERVICE_ID bigint not null,
POLICY_ID bigint,
CUSTOMER_NAME varchar(255),
CREATED_ON datetime(6) not null,
primary key (CUSTOMER_ID),
unique key A_U1 (SERVICE_ID, CUSTOMER_NAME)
);

create index C_2 on CUSTOMERS
(
POLICY_ID
);

I'm looking for help to create the statements on how to change this table to be a partitioned table by list SERVICE_ID first and subpartitioned by CREATED_ON

SERVICE_ID can be one of the following numbers: 01, 02, 03, 04, 05, 06, 07, 08, 09
CREATED_DTM is a timestamp and I want the subpartitions to be daily based.

Please also let me know if I need to upgrade to MySQL 8.0 to get access to better features to do this.

Thanks in advance!

Options: ReplyQuote


Subject
Views
Written By
Posted
Help to alter a non partitioned table to partitioned with subpartitions
862
August 28, 2020 05:04AM


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.