what's faster?
DELETE * FROM table_name;
or
DELETE * FROM table_name where 1=1;
why?
does truncate table
work in access?
what's faster?
DELETE * FROM table_name;
or
DELETE * FROM table_name where 1=1;
why?
does truncate table
work in access?
This should be faster:
DELETE * FROM table_name;
because RDBMS don't have to look where
is what.
You should be fine with truncate
though:
truncate table table_name
There is a mySQL bug report from 2004 that still seems to have some validity. It seems that in 4.x, this was fastest:
DROP table_name
CREATE TABLE table_name
TRUNCATE table_name
was DELETE FROM
internally back then, providing no performance gain.
This seems to have changed, but only in 5.0.3 and younger. From the bug report:
[11 Jan 2005 16:10] Marko Mäkelä
I've now implemented fast TRUNCATE TABLE, which will hopefully be included in MySQL 5.0.3.