O'Reilly logo

MySQL 8 Cookbook by Karthik Appigatla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

ADD partitions

To add a new partition, execute the ADD PARTITION (<PARTITION DEFINITION>) statement:

mysql> ALTER TABLE event_history ADD PARTITION (PARTITION p20171016 VALUES LESS THAN (736983) ENGINE = InnoDB,PARTITION p20171017 VALUES LESS THAN (736984) ENGINE = InnoDB);

This statement locks the whole table for a very short time.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required