Sekhar, ----- Original Message ----- From: ""Sekhar.Thota"" <[EMAIL PROTECTED]> Newsgroups: mailing.database.mysql Sent: Tuesday, December 03, 2002 3:14 PM Subject: truncate table ...
> Dear All, > > I am getting a severe problem with truncate comand( InnoDB Tables > - > Mysql 3.23.52-MAX on Linux 7.3) . > > The scenario is: > > I have a table with more than 100 Million records. I gave a > truncate table command to delete all the data from this table. Once > I gave this > comand it is truncating all the records. The count is showing that it > have 0 rows but still the show table status is showing that it is > having all the 100 Million records in that table and the problem is > after some time it is not allowing any sessions to open and all the > existing session are hanging up. > > Please help me by telling what I have to do in this scenario. I > restarted the server it self but still no session can able to open. TRUNCATE TABLE tablename; currently runs internally as DELETE FROM tablename; That takes time. Workaround: use DROP TABLE + CREATE TABLE. I hope in MySQL-4.0.7 TRUNCATE TABLE will be fast for InnoDB, i.e., it will be internally mapped as DROP + CREATE. > Regards, > Sekhar Best regards, Heikki Tuuri Innobase Oy --- InnoDB - transactions, hot backup, and foreign key support for MySQL See http://www.innodb.com, download MySQL-Max from http://www.mysql.com sql query --------------------------------------------------------------------- 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