Skip to content

Commit 3338238

Browse files
authored
Update 04-data-recycle.md
1 parent 5e9e6aa commit 3338238

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

docs/en/guides/57-data-management/04-data-recycle.md

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,31 @@ Before DELETE: After DELETE: After VACUUM:
2121

2222
## VACUUM Commands and Cleanup Scope
2323

24-
Databend provides three VACUUM commands to clean different types of data. **Understanding what each command cleans is crucial** - some commands only clean storage data, while others clean both storage and metadata.
24+
Databend provides three VACUUM commands with **different cleanup scopes**. Understanding what each command cleans is crucial for data management.
2525

26-
| Command | Target Data | S3 Storage | Meta Service | Details |
27-
|---------|-------------|------------|--------------|---------|
28-
| **VACUUM DROP TABLE** | Dropped tables after `DROP TABLE` |**Removes**: All data files, segments, blocks, indexes, statistics |**Removes**: Table schema, permissions, metadata records | **Complete purge** - table cannot be recovered |
29-
| **VACUUM TABLE** | Table history & orphan files |**Removes**: Historical snapshots, orphan segments/blocks, old indexes/stats |**Preserves**: Table structure and current metadata | **Storage-only** - table remains active |
30-
| **VACUUM TEMPORARY FILES** | Spill files from queries (joins, aggregates, sorts) |**Removes**: Temporary spill files from crashed/interrupted queries |**No metadata**: Temp files have no associated metadata | **Storage-only** - rarely needed, auto-cleaned normally |
26+
```
27+
VACUUM DROP TABLE
28+
├── Target: Dropped tables (after DROP TABLE command)
29+
├── S3 Storage: ✅ Removes ALL data (files, segments, blocks, indexes, statistics)
30+
├── Meta Service: ✅ Removes ALL metadata (schema, permissions, records)
31+
└── Result: Complete table removal - CANNOT be recovered
32+
33+
VACUUM TABLE
34+
├── Target: Historical data and orphan files for active tables
35+
├── S3 Storage: ✅ Removes old snapshots, orphan segments/blocks, indexes/stats
36+
├── Meta Service: ❌ Preserves table structure and current metadata
37+
└── Result: Table stays active, only history cleaned
38+
39+
VACUUM TEMPORARY FILES
40+
├── Target: Temporary spill files from queries (joins, sorts, aggregates)
41+
├── S3 Storage: ✅ Removes temp files from crashed/interrupted queries
42+
├── Meta Service: ❌ No metadata (temp files don't have any)
43+
└── Result: Storage cleanup only, rarely needed
44+
```
45+
46+
---
3147

32-
> **Critical**: Only `VACUUM DROP TABLE` removes metadata from the meta service. The other commands only clean storage files.
48+
> **🚨 Critical**: Only `VACUUM DROP TABLE` affects the meta service. Other commands only clean storage files.
3349
3450
## Using VACUUM Commands
3551

0 commit comments

Comments
 (0)