cassandratombstone

Is it possible to estimate the percentage of tombstones in a table?


I am currently working on a script to calculate percentage of tombstones in target table, based on the threshold percentage, I want to provide user option to run compaction. So is it possible to estimate the percentage of tombstone on a table and how is that possible ? During my research I found system.compaction_history table with table_name, bytes_in and bytes_out columns with which I can make decisions but not sure my logic is correct or not.

Thanks for help in advance.

Regards, Jay


Solution

  • Use sstablemetadata instead. You'll get a value for the column:

    Estimated droppable tombstones: 0.9188263888888889
    

    But, you have to be careful with this because it's not a percentage of droppable. It's an estimation of the ratio of droppable tombstones to non-droppable columns within an SSTable. It indicates the proportion of tombstones that can be removed during compaction, relative to the total number of non-droppable columns present.