How to archive large MySQL tables into archive tables

Here’s one to keep for later:

<br /> CREATE TABLE archive_2008_09 engine=archive AS<br /> SELECT * FROM my_log<br /> WHERE YEAR(logdate)=2008 AND MONTH(logdate)=9<br />
In MySQL this will create a nice compact archive table worth a month of data, having the same structure as the source table.

Related Posts