nodetool getsstables
Lists SSTables containing a partition key.
Synopsis
Section titled “Synopsis”nodetool [connection_options] getsstables [--hex-format] <keyspace> <table> <key>See connection options for connection options.
Description
Section titled “Description”nodetool getsstables identifies which SSTable files contain data for a specific partition key. This is useful for debugging, investigating data distribution, or understanding where specific data resides on disk.
Arguments
Section titled “Arguments”| Argument | Description |
|---|---|
keyspace | Target keyspace name |
table | Target table name |
key | Partition key value |
Options
Section titled “Options”| Option | Description |
|---|---|
-hf, --hex-format | Interpret key as hex-encoded bytes |
-l, --show-levels | Include SSTable level information (for LCS) |
Examples
Section titled “Examples”Basic Usage
Section titled “Basic Usage”nodetool getsstables my_keyspace my_table user123Hex-Encoded Key
Section titled “Hex-Encoded Key”nodetool getsstables --hex-format my_keyspace my_table 0x1234567890abcdefSample Output
Section titled “Sample Output”/var/lib/cassandra/data/my_keyspace/my_table-12345678901234567890/mc-1-big-Data.db/var/lib/cassandra/data/my_keyspace/my_table-12345678901234567890/mc-5-big-Data.dbUse Cases
Section titled “Use Cases”Debug Data Location
Section titled “Debug Data Location”# Find which SSTables contain specific partitionnodetool getsstables my_keyspace users user_12345Investigate Hot Partitions
Section titled “Investigate Hot Partitions”# Check if hot key spans multiple SSTablesnodetool getsstables my_keyspace events hot_partition_key | wc -lVerify Compaction
Section titled “Verify Compaction”# Before and after compaction, check key distributionnodetool getsstables my_keyspace my_table test_keyBest Practices
Section titled “Best Practices”Usage Guidelines
- Know key format - Ensure correct key encoding
- Multiple SSTables normal - Data may span multiple files
- Post-compaction - Fewer SSTables after compaction
Related Commands
Section titled “Related Commands”| Command | Relationship |
|---|---|
| tablestats | Table SSTable counts |
| compact | Force compaction |
| getendpoints | Find replicas for key |