Skip to Content
MySQL 8 Cookbook
book

MySQL 8 Cookbook

by Karthik Appigatla
January 2018
Intermediate to advanced
446 pages
12h 57m
English
Packt Publishing
Content preview from MySQL 8 Cookbook

Copying individual partitions of a table

You added a new partition of the events_history table on the source and you wish to copy only the new partitions to the destination. For the sake of your understanding, create new partitions on the events_history table and insert a few rows:

mysql> ALTER TABLE event_history ADD PARTITION(PARTITION p20171018 VALUES LESS THAN (736985) ENGINE = InnoDB, PARTITION p20171019 VALUES LESS THAN (736986) ENGINE = InnoDB);Query OK, 0 rows affected (0.06 sec)Records: 0  Duplicates: 0  Warnings: 0mysql> INSERT INTO event_history VALUES(9,'test','2017-10-17','2017-10-17','click','test_message'),(10,'test','2017-10-18','2017-10-18','click','test_message');Query OK, 1 row affected (0.01 sec)mysql> SELECT * FROM event_history ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

MySQL Cookbook

MySQL Cookbook

Paul DuBois
Advanced MySQL 8

Advanced MySQL 8

Eric Vanier, Birju Shah, Tejaswi Malepati

Publisher Resources

ISBN: 9781788395809Other