Helpful Information
 
 
Category: MySQL
Database maintenance

Another basic question that I have not been able to find an answer to. Let's say I have a database, and I am comfortable only keeping the last X number of current records - the older ones I can discard. Can I simply delete the oldest record whenever I exceed X and have the database size be constant? Or will there be 'gas' in the database and I will need to do some kind of compress function regularly to prevent it from growing?

G

mysql has built in clean up functions so your best bet would be to write a part in to your code to automaticly delete and clean up the db as records were added. Or write a shell script and use the crontab to run it ever so often...

Thanks much, Javaman.... I wonder do most concern themselves with this?

G










privacy (GDPR)