Skip to content

AxonOps — AI-Native Control Plane for Open Source Data Platforms

nodetool getcolumnindexsize

Cassandra 4.1+

This command is available in Cassandra 4.1 and later.

Displays the current column index size threshold.


Terminal window
nodetool [connection_options] getcolumnindexsize

See connection options for connection options.


nodetool getcolumnindexsize displays the current column index size threshold in kilobytes. This threshold controls how frequently Cassandra creates index entries within partitions when writing SSTables. The column index (more accurately called the partition index) enables efficient row lookups within large partitions.

Understanding the Column Index

Despite the name "column index," this setting controls partition index granularity—how Cassandra navigates within partitions to find specific rows. See setcolumnindexsize for detailed explanation of what this index does and its significance.


The column index size threshold determines the maximum amount of partition data written before Cassandra creates an index entry:

Displayed ValueMeaning
16 KBIndex entry created every 16 KB of partition data
64 KB (default)Index entry created every 64 KB of partition data
128 KBIndex entry created every 128 KB of partition data
Partition Data (256 KB total)
With 64 KB threshold (default):
┌────────────┬────────────┬────────────┬────────────┐
│ Block 1 │ Block 2 │ Block 3 │ Block 4 │
└────────────┴────────────┴────────────┴────────────┘
▲ ▲ ▲ ▲
Index 1 Index 2 Index 3 Index 4
→ 4 index entries = 4 possible seek points
With 128 KB threshold:
┌──────────────────────┬──────────────────────┐
│ Block 1 │ Block 2 │
└──────────────────────┴──────────────────────┘
▲ ▲
Index 1 Index 2
→ 2 index entries = 2 possible seek points (less precise)

Terminal window
nodetool getcolumnindexsize

Sample output:

Current value for column_index_size: 64 KiB
Terminal window
ssh 192.168.1.100 "nodetool getcolumnindexsize"
check_column_index_cluster.sh
#!/bin/bash
echo "=== Column Index Size Across Cluster ==="
# Get list of node IPs from local nodetool status
nodes=$(nodetool status | grep "^UN" | awk '{print $2}')
for node in $nodes; do
echo -n "$node: "
ssh "$node" "nodetool getcolumnindexsize 2>/dev/null | grep -oP '\d+ KiB' || echo 'FAILED'"
done

Sample output:

=== Column Index Size Across Cluster ===
192.168.1.101: 64 KB
192.168.1.102: 64 KB
192.168.1.103: 32 KB <-- Inconsistent!

The default value of 64 KB is appropriate for most workloads. This provides:

  • Reasonable index granularity for partitions up to ~10 MB
  • Balanced memory usage for index storage
  • Good read performance for typical access patterns

Indicates the cluster has been tuned for:

  • Large partitions (> 10 MB average)
  • Frequent point queries on wide partitions
  • Latency-sensitive read workloads

Trade-off: Higher memory usage for index storage.

Indicates the cluster has been tuned for:

  • Small partitions (< 100 KB average)
  • Memory-constrained nodes
  • Workloads where read latency is less critical

Trade-off: Potentially slower row lookups within partitions.


When read latency is higher than expected:

Terminal window
# Check current setting
nodetool getcolumnindexsize
# Compare with partition sizes
nodetool tablestats my_keyspace.my_table | grep -E "partition size"
# If large partitions + large column index size = potential issue

Ensure consistent configuration across cluster:

audit_column_index.sh
#!/bin/bash
echo "Checking column index size consistency..."
values=()
for node in $(nodetool status | grep "^UN" | awk '{print $2}'); do
value=$(ssh "$node" "nodetool getcolumnindexsize 2>/dev/null | grep -oP '\d+')"
values+=("$node:$value")
done
# Check for inconsistency
unique_values=$(printf '%s\n' "${values[@]}" | cut -d: -f2 | sort -u | wc -l)
if [ "$unique_values" -gt 1 ]; then
echo "WARNING: Inconsistent column index sizes detected!"
printf '%s\n' "${values[@]}"
else
echo "OK: All nodes have consistent column index size"
fi

Always check current value before making changes:

Terminal window
# Document current state
echo "Current column index size: $(nodetool getcolumnindexsize)"
echo "Partition sizes:"
nodetool tablestats my_keyspace.my_table | grep -i "partition"
# Then make informed decision about changes

The displayed value reflects the runtime setting, which may differ from cassandra.yaml:

SourcePrecedencePersistence
nodetool setcolumnindexsizeActive at runtimeLost on restart
cassandra.yamlLoaded at startupPermanent
Terminal window
# Runtime value (what's actually in use)
nodetool getcolumnindexsize
# Configuration file value (what will be used after restart)
grep "column_index_size" /etc/cassandra/cassandra.yaml

If these differ, the runtime value was changed via nodetool setcolumnindexsize and will revert to the configuration file value on restart.


Based on the value returned:

If Value IsAnd Partition Sizes AreConsider
64 KBSmall (< 100 KB)Increasing to 128 KB to save memory
64 KBLarge (> 10 MB)Decreasing to 32 KB for better read latency
16-32 KBSmallIncreasing to 64 KB (default may be better)
128+ KBLargeDecreasing for better read performance

Terminal window
# Check both
nodetool getcolumnindexsize
grep column_index_size /etc/cassandra/cassandra.yaml
# If different, someone used setcolumnindexsize
# Either update cassandra.yaml or wait for restart
Terminal window
# Standardize across cluster
TARGET_SIZE=64
for node in $(nodetool status | grep "^UN" | awk '{print $2}'); do
echo "Setting column index size on $node..."
ssh "$node" "nodetool setcolumnindexsize $TARGET_SIZE"
done
# Update cassandra.yaml on all nodes for persistence

See the comprehensive guide in setcolumnindexsize for:

  • How to analyze partition sizes
  • Trade-offs of different values
  • Tuning workflow and best practices

CommandRelationship
setcolumnindexsizeModify the threshold (includes detailed explanation)
tablestatsCheck partition sizes to inform tuning decisions
infoView memory usage including index structures