tarantool / tarantool/doc

TCS: truncate table

Open
#5,434 0 comments 0 reactions 1 assignee View on GitHub

@lenkis is already working on this.

Since Oct 17, 2025.

TCS
Dominant language
CSS
Stars
15
Forks
49
Avg merge
1d 13h
Merged PRs (30d)
3

Description

Related dev. resources:

Product: TCS
Since: 1.2
Audience/target: admins, end users (finops)
Root document: https://www.tarantool.io/ru/column-store/doc/latest/
SME: @ Galiev-Ruslan

Details

Document TRUNCATE syntax + limitations

Don't see truncate in DF doc: https://datafusion.apache.org/user-guide/sql/

Google AI says:

Apache DataFusion, as a query engine, supports the TRUNCATE TABLE SQL statement for removing all rows from a table. This operation is generally faster than a DELETE statement without a WHERE clause, especially for large tables, because it typically deallocates the entire data space of the table rather than deleting row by row.

Syntax:
The basic syntax for truncating a table in DataFusion, similar to standard SQL, is:

TRUNCATE TABLE table_name;

Key Characteristics and Considerations:

  • Removes all rows: TRUNCATE TABLE removes all data from the specified table.
  • Retains table structure: Unlike DROP TABLE, TRUNCATE TABLE preserves the table's schema, including its columns, constraints (with some exceptions), and indexes.
  • Performance: It is generally more efficient than DELETE FROM table_name; for emptying an entire table, as it avoids logging individual row deletions.
  • Transactionality: The behavior regarding transactions can vary depending on the underlying storage system and DataFusion's integration.
  • Foreign Key Constraints: TRUNCATE TABLE may fail if the table has foreign key constraints referencing it from other tables, especially in certain database systems.
  • No WHERE clause: TRUNCATE TABLE does not support a WHERE clause; it always operates on the entire table.

Example:
To remove all data from a table named my_data, you would execute the following SQL query in DataFusion:

TRUNCATE TABLE my_data;

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.