Mysql – way to have thesql automatically create partitions as needed

MySQLpartitioning

We have a large table with columns, date, tag, country. We would like to partition the table by YEAR(date), tag, country, but would like to have mysql create the partitions on the fly. i.e. We don't want to set the number of partitions up front when the partitions are setup and then have to remember to add new partitions in the future.

Best Answer

Why do you want to use partitions? "Large" is not a reason; I have seen billion-row tables that work just fine without partitioning. PARTITIONing are unlikely to provide any benefit.

If you will be deleting "old" data based on the YEAR(date), that is a good use case for partitioning.

More discussion shows how to DROP the oldest partition, etc.