- Newest
- Most votes
- Most comments
Hi!
-
In MySQL, just like Oracle, if you're defining a primary key or unique key on a partitioned table, the partition key column must be part of every unique key. This means, if you're partitioning by a date column, that column needs to be part of any primary or unique key.
-
Unlike Oracle's interval partitioning which automatically creates new partitions for new data, MySQL does not have such a feature natively. In MySQL, you'd have to manage and create partitions manually ahead of time. If an appropriate partition does not exist for data, the insert will indeed fail. Automating this process would typically require a custom script or scheduled task to pre-create partitions for future dates.
-
In MySQL, there's no distinction between local and global indexes as there is in Oracle. When you create an index on a partitioned table in MySQL, it essentially becomes a 'local' index, meaning each partition has its own distinct set of index data. There's no equivalent to Oracle's global index in MySQL's partitioning model.
-
For MySQL 5.7, the default limit is 8192 partitions. However, having thousands of partitions on a single table may lead to its own management and performance challenges, so always consider the specific needs and access patterns of your application.
I hope this helps! If this solution works for you, please accept the answer. Otherwise, do leave a comment, and I'll try to assist you.
Thank you so much. It helped.
One related question, as one of the use cases of partitioning is easy maintenance. One of the key things is data retention or purging requirement. And I believe we need to have to have Jobs/schedulers created for dropping the partitions.
But wanted to know, irrespective of table being partitioned or not, does Aurora mysql provides any easy automated way to purge the data? Something like, just define the retention period (or time to live) for a table and rest will be taken care automatically by the aurora mysql internally? Or we need to write the delete rows/drop partition script and schedule lamda manually for that?
I have created partitions in my MySQL Aurora database and subsequently dropped old partitions. However, despite removing approximately 75% of the data, the table size remains unchanged at 3TB. Can anyone guide me on how to reduce the table size?"
Relevant content
- asked a year ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated a month ago
Any update?