SQL tables are growing rapidly, such as manage them well?

I believe that it is worthwhile to work in a post that deals database “asteriskcdrdb” and specifically the CDR tables and cell

These two tables are growing rapidly especially PBXs with many interior where traffic is intense

I have some PBX where the pace of growth of trabella cell grows by more than 100Mb per month!

This leads to tablelle that exceed the G in a short time to continue …

A simple query that deletes records with “old” repeated at regular intervals divrebbe solve …

Someone has already done?

That’s query, I do not think we need to be clear comments are, of course you have to choose the date from which clear …:

DELETE FROM cdr WHERE calldate < ‘$datexample.’

DELETE FROM cel WHERE eventtime < ‘$datexample.’

you can set up a cronjob to (modified to suit) with:-

0 0 1 * * /usr/bin/mysql -D asteriskcdrdb -ppassword -u user -e "DELETE FROM cdr WHERE calldate  < (NOW() - INTERVAL 1 MONTH)";/usr/bin/mysql -D asteriskcdrdb -ppassword -u user -e "DELETE FROM cel WHERE eventtime  < (NOW() - INTERVAL 1 MONTH)"