lucabecchetti / laravel-mysql-partition

Useful Laravel package to easily work with MySQL Partition
Other
139 stars 23 forks source link

Dynamic partition range #9

Closed digitall-it closed 2 years ago

digitall-it commented 2 years ago

Is it possible to have a structure where the partition zoning is dynamic, for example Current: current year Archive: less than current year

or

Current: last 12 months Archive: more than 12 months

and migrate all the data from one partition to another in a scheduled Laravel task or automatically by the database?

This would make a very useful and automatic use case for the package.

By the way, greetings from Ischia, Napoli.

lucabecchetti commented 2 years ago

I'm sorry... there is no this feature at the moment!

ipearx commented 2 years ago

Is it possible to have a structure where the partition zoning is dynamic, for example Current: current year Archive: less than current year

Why do this? The main advantage of a partition is to delete bulk old data fast. If you're keeping old data, you might as well use a single big table, with an index by date? This article was handy to explain it to me: http://mysql.rjweb.org/doc.php/partitionmaint

digitall-it commented 2 years ago

Thank you, the article is illuminating on some myths on partitioning.