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.
Mysql – way to have thesql automatically create partitions as needed
MySQLpartitioning
Related Question
- Mysql – Want to create partitions of a MySQL table and change the charset of new partitions
- MySQL – Best Practices for Structuring Logging Application Data
- Mysql – Any way to speed up reorganize partition of a very large table in MySQL
- MySQL – Move data between partitions aka re-partition
- Sql-server – Altering the existing partition which is partitioned by date range in SQL Server 2012
- Mysql – Create Range Partition on existing large MySQL table
- Postgresql – way to search the earliest or latest postgres partition for table
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.