3

In the documentation for expiring data for Cassandra (here) it is mentioned that

Expiring data has an additional overhead of 8 bytes in memory and on disk (to record the TTL and expiration time) compared to standard data.

If one sets a TTL (time-to-live) on a table level, does that mean that for each data entry there is an overhead of 8 bytes more in memory and on disk multiplied by the number of columns, or it's independent of the number of columns?

For example, in the documentation one also finds the example here to determine the TTL for a column, even though data is inserted on more than 1 column and TTL is defined for the actual data entry being inserted, not on a per-column basis.

Filipe Freire
  • 823
  • 7
  • 21

2 Answers2

2

According to Cassandra documentation, on the create table section it says:

default_time_to_live

TTL (Time To Live) in seconds, where zero is disabled. When specified, the value is set for the Time To Live (TTL) marker on each column in the table; default value: 0. When the table TTL is exceeded, the table is tombstoned.

Meaning that when you define a TTL for the table, it is valid for each column (except the primary key).

2

No, not anymore at least. That documentation is outdated and only relevant pre 3.0.

Currently if all the columns in a partition or a row in a partition have same TTL set at insertion it is just set the once for it. If they are stored they are written delta encoded from sstables minTimestamp as an unsigned variable int, not 8 bytes.

Chris Lohfink
  • 16,150
  • 1
  • 29
  • 38