Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Support move truncated old data to recycle bin #1324

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions docs/data-operate/delete/truncate-manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ This statement is used to clear the data of a specified table or partition in Do
## Syntax

```SQL
TRUNCATE TABLE [db.]tbl[ PARTITION(p1, p2, ...)];
TRUNCATE TABLE [db.]tbl[ PARTITION(p1, p2, ...)] FORCE?;
```

- This statement only clears the data within a table or partition but preserves the table or partition itself.
- Unlike DELETE, this statement can only clear the specified table or partition as a whole and cannot be added with filter conditions.
- Unlike DELETE, truncating data will not affect query performance.
- The data deleted by this operation is not recoverable.
- The data deleted by this operation can be recovered through the RECOVER statement(for a period of time). See [RECOVER](../../../../sql-manual/sql-statements/Database-Administration-Statements/RECOVER) statement for details. If you execute command with FORCE, the data will be deleted directly and cannot be recovered, this operation is generally not recommended.
- When using this command, the table status must be NORMAL, which means that tables undergoing SCHEMA CHANGE can not be truncated.
- This command may cause ongoing imports to fail.

Expand All @@ -55,3 +55,8 @@ TRUNCATE TABLE example_db.tbl;
TRUNCATE TABLE tbl PARTITION(p1, p2);
```

3. Truncate the table `tbl` under `example_db` FORCE.

```SQL
TRUNCATE TABLE example_db.tbl FORCE;
```
Loading