.truncate table
.truncate table
Remove whole indexed files from a table in the current account while preserving its definition, columns, retention policy, and permissions. Requires account administrator permission and a query scope allowing account management and control commands.
Spec
.truncate table "<table_name>" [datetime(<timestamp>)]Parameters
table_name: Table name, supplied as a quoted string.timestamp: Optional cutoff. Deletes a file only when its latest record timestamp is strictly before this value. Acceptsdatetime(...), a quoted timestamp, or an unquoted ISO 8601 timestamp. Values without an offset use UTC; offsets are normalized to UTC. File timestamp metadata has millisecond precision.
Without a timestamp, removes all indexed files. With a timestamp, keeps files that cross the cutoff, end exactly at the cutoff, or have no known latest timestamp. Records within retained files are unchanged. The command affects files registered at execution time; later ingestion remains available. Queries already planned may finish using their earlier snapshot.
Return Value
Completes without result columns or records and emits the query message Deleted {n} files. The count is the number of logical indexed files removed, regardless of replica count. A missing table or invalid timestamp returns an error.
Example
Delete all data while preserving the table:
.truncate table "application logs"Delete files whose latest timestamp is before the cutoff:
.truncate table "application logs" datetime(2026-10-26T00:00:00Z)Equivalent timestamp forms:
.truncate table "application logs" 2026-10-26T00:00:00Z
.truncate table "application logs" "2026-10-26T00:00:00Z"Files leave the catalog immediately. Physical reclamation happens asynchronously, and blob references belonging to removed files are released through the retirement workflow.