Table of Contents Previous Next



2.3.75 TRUNCATE
TRUNCATE -- empty a table
TRUNCATE TABLE name [DROP STORAGE]
TRUNCATE quickly removes all rows from a table. It has the same effect as an unqualified DELETE but since it does not actually scan the table, it is faster. This is most useful on large tables.
The DROP STORAGE clause is accepted for compatibility, but is ignored.
TRUNCATE cannot be used if there are foreign-key references to the table from other tables. Checking validity in such cases would require table scans, and the whole point is not to do one.
TRUNCATE will not run any user-defined ON DELETE triggers that might exist for the table.


Table of Contents Previous Next