nodetool recompress_sstables
Cassandra 4.1+
This command is available in Cassandra 4.1 and later.
Recompresses SSTables with current compression settings.
Synopsis
Section titled “Synopsis”nodetool [connection_options] recompress_sstables [options] [keyspace] [tables...]See connection options for connection options.
Description
Section titled “Description”nodetool recompress_sstables rewrites SSTables using the current compression configuration. Use this after changing a table's compression settings to apply them to existing data.
Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
keyspace | Target keyspace (optional; if omitted, recompresses all keyspaces) |
tables | Optional: specific tables |
Options
Section titled “Options”| Option | Description |
|---|---|
-j, --jobs | Number of parallel jobs |
Examples
Section titled “Examples”Recompress All Tables
Section titled “Recompress All Tables”nodetool recompress_sstables my_keyspaceRecompress Specific Table
Section titled “Recompress Specific Table”nodetool recompress_sstables my_keyspace my_tableParallel Recompression
Section titled “Parallel Recompression”nodetool recompress_sstables --jobs 2 my_keyspaceWhen to Use
Section titled “When to Use”After Changing Compression
Section titled “After Changing Compression”# After ALTER TABLE ... WITH compression = ...nodetool recompress_sstables my_keyspace my_tableSwitch Compression Algorithm
Section titled “Switch Compression Algorithm”# Changed from LZ4 to Zstdnodetool recompress_sstables my_keyspace my_tableRelated Commands
Section titled “Related Commands”| Command | Relationship |
|---|---|
| upgradesstables | Upgrade SSTable format |
| compact | Force compaction |