Generally, perhaps, but not for MySQL in particular. DELETE with no
WHERE clause is very fast. This is discussed in the DELETE section
of chapter 7 of the reference manual.
At 8:38 AM -0500 5/19/99, Fraser MacKenzie wrote:
>Generally it is faster to drop a table and recreate it then deleting all
>the records in it.
>On Wed, 19 May 1999, Graeme B. Davis wrote:
>> How about:
>> delete from tablename;
>> delete from tablename2;
>> ----- Original Message -----
>> From: Xah Lee <xah@stripped>
>> To: <mysql@stripped>
>> Sent: Wednesday, May 19, 1999 5:34 AM
>> Subject: best way to wipe info
>> > What's the standard way to wipe out every info in the database but keeps
>> > schema?
>> > What I do now is to dump the database without data to a file, then drop
>> > database, then create it, then load it back from the file. (just learned
>> > from this mailing list)
>> > $mysqldump --no-data --password --host=server_name1 db_name >
>> > $mysqladmin --password --host=server_name1 --force drop db_name
>> > $mysqladmin --password --host=server_name1 create db_name
>> > $mysql --password --host=server_name1 db_name < file_full_path
>> > Are there alternative? and what's the 'proper' way?
>> > Thanks.
>> > Xah
>> > xah@stripped
>> > http://www.best.com/~xah/PageTwo_dir/more.html
>> > "Windoz: a monstrous hack of greed;
>> > unix: a monstrous hack of stupidity;
>> > GNU: stamps out greed, stamps out stupidity."
Paul DuBois, paul@stripped
Northern League Chronicles: http://www.snake.net/nl/