Jack Coxen wrote:
I had originally planned to use syntax similar to:

DELETE * FROM table_name WHERE `dtime` < [90 days ago]

delete * from table_name where to_days(now())-to_days(dtime) > 90


After the DELETE runs, I plan on running MYISAMCHK on the affected table.
Then I'll repeat both steps for all of the other tables in turn.

why myisamchk? to compact the tables? you don't need myisamchk in normal use.


One last thing.  I'm running out of Drive space and am I/O bound - I'm
writing this script in case I can't get the RAID array I'm hoping for.
Because of the I/O problem, execution time can sometimes be a factor in what
I do.  Execution speed is a primary concern.  If this takes a day or two to
run but the application can be running at the same time then there's no
problem.  But if I have to shut down my application for any appreciable
length I time, then I have to find another way of doing this.

if you don't use myisamchk you can lock the table before doing the delete, which ensures that nobody else will be using it. keeps the apps from reading inconsistent data and lets your query run with full speed.


-jsd-



--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to