File Housekeeping (2)


#1

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?


(Franck Danard) #2

Great :slight_smile:
Hmmm I don’t know. about OPTIMIZE TABLE.


#3

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


(Franck Danard) #4

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


#5

très bien Franck mon vieil ami, et toi?


(Franck Danard) #6

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


#7

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: )


(Franck Danard) #8

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


(Dave Burgess) #9

“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.


#10

I already did the optimize table.

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


#11

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


#12

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