Keeping database in check

Does anyone have a recommended maintenance routine for the database?

Before my upgrade from 2.0.7 to 2.0.12 my database was over 400 MB. After deleting my logs and stats, it was down to 120 MB. I used the built-in upgrade and when it was done, my db was 20 MB.

I am cleaning out the logs and stats on an almost daily basis. After about 5 days, however, my database is back up to nearly 50 MB. :confused: The sessions table was mentioned as a possible culprit, but I checked it and it only has 600 records.

Anyway, this makes me think some sort of routine maintenance is necessary outside of deleting the logs and statistics. I realize optimization helps too, but it only accounts for a few MB here and there.

Does anyone know what type of database maintenance needs to be done? What other tables would be taking up so much space so quickly?

I too am curious as to any DB maintenance that should be done on a regular basis.


Why does the size matter?

I don’t think size necessarily matters, but a bloated database could potentially slow down the site or cause other issues. It makes me think something is wrong since it grows so quickly and I haven’t found the source of it. Also, just upgrading to 2.0.12 eliminated 100 MB of data that was obviously unnecessary. If there is some sort of regular maintenance routine to get rid of unnecessary data it seems like it would be a good idea.

My database is growing by 6 MB a day, so it’s up to about 70 MB now. :confused: