Documentation — Commands reference

truncate

Removes all the rows of a table and keeps the table.

Syntax

truncate [table] TABLE_NAME;
  • You need the TRUNCATE privilege.
  • The table must be deployed and not locked.
  • If a partition of the table has no available server, the command is refused.
  • When a data broker fails to truncate its segments while the others succeed, the answer says Table truncated. Warning: N data broker(s) could not truncate it and those segments are out of date: use repair table.

delete from TABLE_NAME; without a where has the same effect, but slower.

Wide tables

Works the same way: every chunk of every partition is emptied.

← source  |  update →