This is a discussion on Re: How to delete all rows.... within the MySQL General forum forums, part of the MySQL category; --> Hi, Its delete * from table will only do if you go for a truncate it will recreate the ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, Its delete * from table will only do if you go for a truncate it will recreate the table structure ?.... It's better to use delete. Thanks & Regards Dilipkumar ----- Original Message ----- From: "Peter Lauri" <lists@dwsasia.com> To: <ravi.karatagi@wipro.com>; <mysql@lists.mysql.com> Sent: Wednesday, September 20, 2006 1:25 PM Subject: RE: How to delete all rows.... > DELETE FROM table > > -----Original Message----- > From: ravi.karatagi@wipro.com [mailto:ravi.karatagi@wipro.com] > Sent: Wednesday, September 20, 2006 10:35 AM > To: mysql@lists.mysql.com > Subject: How to delete all rows.... > > > Hi All, > > How do I delete all the rows of all the tables(but not > table) in the database at one shot. > > > > > Regards, > > Ravi K > > > > > > > > The information contained in this electronic message and any attachments > to > this message are intended for the exclusive use of the addressee(s) and > may > contain proprietary, confidential or privileged information. If you are > not > the intended recipient, you should not disseminate, distribute or copy > this > e-mail. Please notify the sender immediately and destroy all copies of > this > message and any attachments. > > > WARNING: Computer viruses can be transmitted via email. The recipient > should > check this email and any attachments for the presence of viruses. The > company accepts no liability for any damage caused by any virus > transmitted > by this email. > > > www.wipro.com > > > -- > MySQL General Mailing List > For list archives: http://lists.mysql.com/mysql > To unsubscribe: > http://lists.mysql.com/mysql?unsub=d...h@sifycorp.com > ********** DISCLAIMER ********** Information contained and transmitted by this E-MAIL is proprietary to Sify Limited and is intended for use only by the individual or entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If this is a forwarded message, the content of this E-MAIL may not have been sent with the authority of the Company. If you are not the intended recipient, an agent of the intended recipient or a person responsible for delivering the information to the named recipient, you are notified that any use, distribution, transmission, printing, copying or dissemination of this information in any way or in any manner is strictly prohibited. If you have received this communication in error, please delete this mail & notify us immediately at admin@sifycorp.com Watch the latest updates on Mumbai, with video coverage of news, events, Bollywood, live darshan from Siddhivinayak temple and more, only on www.mumbailive.in Watch the hottest videos from Bollywood, Fashion, News and more only on www.sifymax.com |
| |||
| Dilipkumar wrote: > Hi, > > Its delete * from table will only do if you go for a truncate it will > recreate the table structure ?.... > It's better to use delete. Can you explain why? I'd go for instant truncate rather than waiting around for delete to finish. |
| |||
| mos wrote: > At 08:41 PM 9/25/2006, you wrote: >> Dilipkumar wrote: >>> Hi, >>> Its delete * from table will only do if you go for a truncate it will >>> recreate the table structure ?.... >>> It's better to use delete. >> >> Can you explain why? I'd go for instant truncate rather than waiting >> around for delete to finish. > > The drawback of truncate is it requires a table lock and if people are > updating the table, the truncate will have to wait for the locks to > complete. So will a delete from table when it's myisam. > There is also RI to worry about. Good point. |
| ||||
| At 08:41 PM 9/25/2006, you wrote: >Dilipkumar wrote: >>Hi, >>Its delete * from table will only do if you go for a truncate it will >>recreate the table structure ?.... >>It's better to use delete. > >Can you explain why? I'd go for instant truncate rather than waiting >around for delete to finish. The drawback of truncate is it requires a table lock and if people are updating the table, the truncate will have to wait for the locks to complete. There is also RI to worry about. Mike |