HiveBrain v1.2.0
Get Started
← Back to all entries
patternMinor

Data retention in Mariadb

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
dataretentionmariadb

Problem

I want to retain data for 90 days only for all 15 tables in my Mariadb database.
Current db size is 60 GB.
What are the options available for performing the same.

Solution

You could PARTITION BY RANGE(TO_DAYS(...)) each table. However, it is somewhat strange to have more than one table that is big and in need of purging periodically.

I would recommend weekly partitions. More details: Partition

Be aware that you should redo many of the indexes when Partitioning. And Partitioning is unlikely to provide any performance benefit except for the periodic DROP PARTITION and REORGANIZE PARTITION.

Context

StackExchange Database Administrators Q#324256, answer score: 3

Revisions (0)

No revisions yet.