At 01:22 AM 5/19/2002, you wrote:
>Dear all,
>
>I have some large MySQL tables and II want to delete for example month
>2-2002
>entirelly from an sql table.
>
>I use now ...
>delete from table_name where year(data)=2002 and month(data)=2;
>
>I have almost 25.000.000 row and something like 7-8 mil is from month 2.
>
>Seems to make it for 2 hours and it's very much as time, I need other tables
>as well to clean up and then need to stop too much from clients the
>database.
>
>Can be do this in other way?
>
>Also if there a possibilities to export and delete this records??
>
>Regards,
>Valics Lehel

Valics,
         If you are using MyISAM tables, you may want to put each month 
into a separate table, and then have your query use Merge Tables (quite 
fast). To delete a month, delete all the rows from the table which takes a 
few milliseconds (MySQL is basially dropping the table and rebuilding it 
when you do a "delete * from myisam_table" or change your merge tables 
definition.

Mike


>---------------------------------------------------------------------
>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


---------------------------------------------------------------------
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

Reply via email to