There is a database table for logging purpose only so old records are useless. Is there an easy way to automatically delete old records and keep most recent records only (say, records created in last 7 days, or, the latest 1 million records). The table uses MyISAM engine and have a timestamp column but do not have primary key (for fast insertion).
A:
U can put your Logic in Insert Trigger to delete your old records
Nitesh Katare
2010-10-27 05:37:08
@Nitesh - But that would slow down certain insertions, right?
powerboy
2010-10-27 05:47:34
you can put some condition in the procudure ex: if Total Number of Records in more than 1 million den the trigger has to fire in this way u can maintain the same performance.
Nitesh Katare
2010-10-27 07:22:55