File Housekeeping (2)

The help provided by closed thread

was helpful. Thank you!

After running the command,

MariaDB [asterisk]> delete from asteriskcdrdb.cdr where calldate < now() - interval 3 MONTH;
Query OK, 744002 rows affected (58.40 sec)

My backup filesize went from
224M
to
212M

OPTIMIZE TABLE was no help.
Should it be this big?

1 Like

Great :slight_smile:
Hmmm I donā€™t know. about OPTIMIZE TABLE.

You should probably do the same thing with asteriskcdr.cel on the eventtime column.

2 Likes

Hey Dicko. How are you man :slight_smile:
Yes you are right.

1 Like

trĆØs bien Franck mon vieil ami, et toi?

Je vais bien aussi.
Iā€™m good too, even if in France, the lockdown is restarted for 1 month (Dec 1th).

Luckily we in the USA are just fine as we have ā€˜turned the cornerā€™ according to our revered President.

(oops, looks like we took a left instead of a right at that corner :slight_smile: )

1 Like

Whatever your choice the next week. I hopefully you will get the good one. :wink:

ā€œOptimize tableā€ compresses the table down and re-validates all of the indices. Basically, it gets rid of all of the records that have been marked for deletion and reclaims the space in the table space, then it initiates an index update to point the index entries to the new places where the records are in the database.

The ā€œbestā€ time for an optimize is after youā€™ve deleted a series of records over a given period of time. Since this operation deleted a chunk of the dataspace, an optimize is warranted.

1 Like

I already did the optimize table.

How do i
do the same thing with asteriskcdr.cel on the eventtime column

delete from asteriskcdrdb.cel where eventtime < now() - interval 3 MONTH;

1 Like

MariaDB [asterisk]> delete from asteriskcdrdb.cel where eventtime < now() - interval 3 MONTH;
Query OK, 3501280 rows affected (3 min 18.80 sec).

WOW!
THANK YOU!! That brought the backup down to 46M

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.