sstablepartitions

Identifies large partitions of SSTables.

Identifies large partitions of SSTables and generate output in JSON format. The output includes the partition size, row count, cell count, and tombstone count.

Synopsis

sstablepartitions 
[-b] [-c cell_count_threshold] 
[-k partition_keys] [-m]
[-o tombstone_count_threshold] 
[-r] [-t partition_count_threshold]
[-u] [-x partition_keys|-y]
sstable_name|sstable_directory
Table 1. Legend
Syntax conventions Description
UPPERCASE Literal keyword.
Lowercase Not literal.
Italics Variable value. Replace with a valid option or user-defined value.
[ ] Optional. Square brackets ( [ ] ) surround optional command arguments. Do not type the square brackets.
( ) Group. Parentheses ( ( ) ) identify a group to choose from. Do not type the parentheses.
| Or. A vertical bar ( | ) separates alternative elements. Type any one of the elements. Do not type the vertical bar.
... Repeatable. An ellipsis ( ... ) indicates that you can repeat the syntax element as often as required.
'Literal string' Single quotation ( ' ) marks must surround literal strings in CQL statements. Use single quotation marks to preserve upper case.
{ key:value } Map collection. Braces ( { } ) enclose map collections or key value pairs. A colon separates the key and the value.
<datatype1,datatype2> Set, list, map, or tuple. Angle brackets ( < > ) enclose data types in a set, list, map, or tuple. Separate the data types with a comma.
cql_statement; End CQL statement. A semicolon ( ; ) terminates all CQL statements.
[ -- ] Separate the command line options from the command arguments with two hyphens ( -- ). This syntax is useful when arguments might be mistaken for command line options.
' <schema> ... </schema> ' Search CQL only: Single quotation marks ( ' ) surround an entire XML schema declaration.
@xml_entity='xml_entity_type' Search CQL only: Identify the entity and literal value to overwrite the XML element in the schema and solrconfig files.
Identifies large partitions of the specified SSTable or directory and outputs the partition size, row count, cell count, and tombstone count, where:
sstable_name
The name of the SSTable file. Specify sstable_name or sstable_directory.
sstable_directory
The data directory.
-b,--backups
Include backups in the data directories (recursive scans).
-c cell_count_threshold,--min-cells cell_count_threshold
Partition cell count threshold. When this threshold for cell count is exceeded, identify as a large partition.
-k partition_keys,--key partition_keys
Include partition keys.
-m,--csv
Instead of JSON formatted output, produce CSV machine-readable output.
-o tombstone_count_threshold,--min-tombstones tombstone_count_threshold
Partition tombstone count threshold.
-r,--recursive
Scan for SSTables recursively.
-s,--snapshots
Include snapshots present in data directories (recursive scans).
-t partition_count_threshold,--min-size partition_count_threshold
Partition size threshold.
-u,--current-timestamp
Include timestamp in output. Timestamp is the number seconds since epoch, unit time for TTL expired calculation.
-x partition_keys,--exclude-key partition_keys
Exclude partition key or keys from partition detailed row/cell/tombstone information. Does not apply if -y option is given.
-y,--partitions-only
Provide brief partition information only. 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

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

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