Are there any performance impact/issues with running “alter table”?

Say we have an existing YCQL (Cassandra) table with about 1M+ rows that needs to have a TTL. The table was initially created without a TTL.

  1. Do you see any performance impact/issues with running “alter table” with default_time_to_live = on an existing table with existing data?

After using such an “alter” operation to set a TTL, does the TTL only affect new data inserted into the table or applies retroactively to existing data? Hoping the latter. Please confirm.

Hi @divingdiana

The alter table to set the TTL should be an online operation. Furthermore, it is a meta-data only update that is done to all the shards (tablets), and doesn’t require reading or re-writing all the data. So the operation should be pretty quick and is not dependent on the data size.

To your second question: The TTL set via the alter table applies retroactively to older/existing data in the table also, not just to newer data.

regards,
Kannan

1 Like