mysql database automatic partitioning

后端 未结 3 1429
借酒劲吻你
借酒劲吻你 2020-12-29 06:51

I have a mysql database table that I want to partition by date, particularly by month & year. However, when new data is added for a new month, I don\'t want to need to m

3条回答
  •  醉话见心
    2020-12-29 07:34

    There are a few solutions out there, if you want a total solution, check this post out on kickingtyres. It's a basic combination of a stored procedure handling the partition analysis and creation (with some logging!).

    All you need to do is adjust it to your partition type (the example uses a bigint partition) and schedule the procedure to run with the MySQL Event Scheduler.

提交回复
热议问题