TRUNCATE TABLE — Deletes all records from the specified table.
TRUNCATE TABLE table-name
The TRUNCATE TABLE statement deletes all of the records from the specified table. TRUNCATE TABLE is the same as the
statement DELETE FROM {table-name}
with no selection clause. These statements
contain optimizations to increase performance and reduce memory usage over an equivalent DELETE statement containing a WHERE
selection clause.
The following behavior is important to remember when using the TRUNCATE TABLE statement in VoltDB:
Executing a TRUNCATE TABLE query on a partitioned table within a single-partitioned stored procedure will only delete the records within the current partition. Records in other partitions will be unaffected.
You cannot execute a TRUNCATE TABLE query on a replicated table from within a single-partition stored procedure. To truncate a replicated table you must execute the query within a multi-partition stored procedure or as an ad hoc query.