MySQL uses the SQL statement TRUNCATETABLE to quickly clear the data of a data table, so that the data table is cleared without retaining logs. Although TRUNCATETABLE is the same as a DELETE statement without WHERE, TRUNCATETABLE is faster and consumes less resources. TRUNCATETABLE does not record logs, so it cannot be excited.
MySQL uses the SQL statement TRUNCATE TABLE 'table name' to quickly clear the data of a data TABLE without retaining logs. Although the truncate table is the same as the DELETE statement without WHERE, the truncate table is faster and occupies less resources. The truncate table does not record logs, so it cannot
SQL statement for MySQL to quickly clear data in a data table
Truncate table 'table name'
In this way, the SQL statement is used to clear the data table without retaining logs.
The truncate table is the same as the DELETE statement without WHERE.
However, TRUNCATE tables are faster and occupy less resources.
The trigger cannot be activated because the truncate table does not record logs.
The truncate table cannot be used in the index view.