sstablepartitions
Identifies large partitions of SSTables and outputs the partition size in bytes, row count, cell count, and tombstone count.
The default location of this SSTable tool depends on the type of installation:
-
Package installations:
/usr/bin/
-
Tarball installations:
<installation_location>/resources/cassandra/tools/bin
Synopsis
sstablepartitions
[-b] [-c <cell_threshold>]
[-k <partition_key>]
[-m] [-o <tombstone_count_threshold>]
[-r] [-t <partition_count_threshold>]
[-u] [-x <partition_key> | -y]
<sstable_filepath> | <sstable_directory>
Syntax conventions | Description |
---|---|
UPPERCASE |
Literal keyword. |
Lowercase |
Not literal. |
<`Italics>` |
Variable value. Replace with a valid option or user-defined value. |
|
Optional.
Square brackets ( |
|
Group.
Parentheses ( |
|
Or.
A vertical bar ( |
|
Repeatable.
An ellipsis ( |
|
Single quotation ( |
|
Map collection.
Braces ( |
|
Set, list, map, or tuple.
Angle brackets ( |
|
End CQL statement.
A semicolon ( |
|
Separate the command line options from the command arguments with two hyphens ( |
|
Search CQL only: Single quotation marks ( |
|
Search CQL only: Identify the entity and literal value to overwrite the XML element in the schema and solrconfig files. |
The short form and long form parameters are comma-separated.
Command arguments
- -b, --backups
-
Include backups in the data directories (recursive scans).
- -c, --min-cells cell_threshold
-
Partition cell count threshold.
- -k, --key partition_key
-
Partition key to include.
- -m, --csv
-
Produce CSV machine-readable output instead of JSON formatted output.
- -o, --min-tombstones tombstone_threshold
-
Partition tombstone count threshold.
- -r, --recursive
-
Recursively.
- sstable_directory
-
The filepath to the SSTable data directory. The data_file_directories property in cassandra.yaml defines the default directory.
- sstable_filepath
-
The explicit or relative filepath to the SSTable data file ending in
Data.db
. - -t, --min-size partition_threshold
-
Partition size threshold in bytes.
- -u, --current-timestamp
-
Include timestamp in output. Timestamp is the number of seconds since epoch, unit time for TTL expired calculation.
- -x, --exclude-key partition_key
-
Partition key to exclude. Ignored if -y option is given.
- -y, --partitions-only
-
Only brief partition information. Exclude per-partition detailed row/cell/tombstone information from process and output.
Examples
Analyze partition statistics for all SSTables a single table
sstablepartitions -r /var/lib/cassandra/data/stresscql/blogposts-7dd6dfc289b511e8a4a329556a9391cc/
Processing stresscql.blogposts-7dd6dfc289b511e8a4a329556a9391cc #3 (bti-aa) (6445137 bytes uncompressed, 5416338 bytes on disk)
Partition size Row count Cell count Tombstone count
p50 124 1 1 1
p75 149 1 1 1
p90 149 2 2 1
p95 179 2 2 1
p99 215 3 3 1
p999 258 4 4 1
min 51 0 0 0
max 8239 179 179 1
count 56696
time 137676
Processing stresscql.blogposts-7dd6dfc289b511e8a4a329556a9391cc #4 (bti-aa) (230134 bytes uncompressed, 192999 bytes on disk)
Partition size Row count Cell count Tombstone count
p50 124 1 1 1
p75 124 1 1 1
p90 149 1 1 1
p95 149 1 1 1
p99 149 1 1 1
p999 179 2 2 1
min 51 0 0 0
max 446 10 10 1
count 2169
time 3626
The unit of measure for the partition size column is bytes. |
Output only partitions with cell count threshold equal to or greater than 10
sstablepartitions -c 10 /var/lib/cassandra/data/stresscql/blogposts-7dd6dfc289b511e8a4a329556a9391cc/aa-4-bti-Data.db
Processing stresscql.blogposts-7dd6dfc289b511e8a4a329556a9391cc #4 (bti-aa) (230134 bytes uncompressed, 192999 bytes on disk)
Partition: 'Fwl
Cc xD06iw_]Q|[t[KzCI& $' (46776c0b4363097815114430361169775f7f5d511b3b08177c5b745b4b1306007a434926091a24) live, position: 208502, size: 434, rows: 10, cells: 10, tombstones: 0 (row:0, range:0, complex:0, cell:0, row-TTLd:0, cell-TTLd:0)
Summary of stresscql.blogposts-7dd6dfc289b511e8a4a329556a9391cc #4 (bti-aa):
File: /home/dimitarndimitrov/.ccm/c13529-master/node1/data0/stresscql/blogposts-7dd6dfc289b511e8a4a329556a9391cc/aa-4-bti-Data.db
1 partitions match
Keys: Fwl
Cc xD06iw_]Q|[t[KzCI& $
Partition size Row count Cell count Tombstone count
p50 124 1 1 1
p75 124 1 1 1
p90 149 1 1 1
p95 149 1 1 1
p99 149 1 1 1
p999 179 2 2 1
min 51 0 0 0
max 446 10 10 1
count 2169
time 4875
The unit of measure for the partition size column is bytes. |
Output CSV machine-readable output
sstablepartitions -c 10 -m /var/lib/cassandra/data/stresscql/blogposts-7dd6dfc289b511e8a4a329556a9391cc/aa-4-bti-Data.db
key,keyBinary,live,offset,size,rowCount,cellCount,tombstoneCount,rowTombstoneCount,rangeTombstoneCount,complexTombstoneCount,cellTombstoneCount,rowTtlExpired,cellTtlExpired,directory,keyspace,table,index,snapshot,backup,generation,format,version
"Fwl
Cc xD06iw_]Q|[t[KzCI& $",46776c0b4363097815114430361169775f7f5d511b3b08177c5b745b4b1306007a434926091a24,true,208502,434,10,10,0,0,0,0,0,0,0,/home/dimitarndimitrov/.ccm/c13529-master/node1/data0/stresscql/blogposts-7dd6dfc289b511e8a4a329556a9391cc/aa-4-bti-Data.db,stresscql,blogposts,,,,4,bti,aa