S
S
samokiller2022-03-14 10:27:37
MySQL
samokiller, 2022-03-14 10:27:37

How to reduce the load on the ssd with daily random dumps?

The database is stored on a separate SSD, the size of the database is about 300 GB for 500 tables. New records are added to 60% of tables every day. New tables are created periodically.

There is a general database dump for a date in the past. I want to dump new data once a day. Those. not the entire database, but only the data that was added during the day.
They are easy to select via "where year=2022 and month=3 and day=14".

But I'm worried that with such a dump:

mysqldump -uroot -p123 -q -n -t --skip-comments --compact  --no-autocommit --where="year=2022 and month=3 and day=14" test > c:/dailyDump.sql


the server scans the entire database every time, including tables in which there is no new data and never will be. In addition, new daily data in any table is about 2% of the size of the entire table.
Those. every day an additional -300 GB of resource from the SSD will go away.

Is it possible to somehow programmatically reduce the load on the SSD, with daily dumps?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Drno, 2022-03-14
@Drno

Well, I don’t care about reading SSD .. let it read
secondly - disks are a consumable. put in a raid, 1 dead - change. if you never know both died - backup)

A
Alexander Karabanov, 2022-03-14
@karabanov

Break the tables into partitions, for example, by day.

S
Slava Rozhnev, 2022-03-14
@rozhnev

incremental backup

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question