Hello, I'm working on a purge utility to purge 3 tables: call_record, modem_call_rec and makrup. Those 3 tables are related with foreign key recid, so I used the following sql to purge data that is older than 30 days:
delete call_record, modem_call_rec, markup from call_record, modem_call_rec, markup where to_days(now())-to_days(call_record.setup)>=30, and call_record.recid=modem_call_rec.recid and call_record.recid=markup.recid; The result is, it works well with limited number of records. But when the number of records increases, for example to 500 records per table, call_record table is purged correctly, but the other two tables (modem_call_rec and markup) are not purged at all. The mysql manual mentioned that delete may not work when deleting tables with correlated columns. Is that the reason why the above query does not work? In my case, I may have 1.5 million records in each table. Could you give me some suggestions regarding how to perform delete in those 3 tables with that many data? Thanks Minjie --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php