Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

pramod.dba31_92912 avatar image
pramod.dba31_92912 asked Erick Ramirez edited

How can we check if compaction is disabled for a table?

1) How can we know if compaction is disabled on a table (possibly done by nodetool disableautocompaction)

2) How to know compaction history of specific keyspace/table?

dse
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Erick Ramirez avatar image
Erick Ramirez answered Erick Ramirez edited

Disabling compaction on a table requires a schema change so you need to check the table's schema to see if compaction is disabled.

Here's an example for disabling compaction on a table:

ALTER TABLE vaccinated
    WITH COMPACTION = {
        'class': 'SizeTieredCompactionStrategy', 
        'enabled': 'false'
    };

For details, see Enabling and disabling background compaction.

There isn't a command for checking the compaction history of a specific table. The nodetool compactionhistory command simply displays the contents of the system.compaction_history table. You can either (1) parse the output of the command using shell scripts, or (2) query the CQL table directly.

For auto-compaction, there isn't a simple way of checking if it has been disabled on a node other than checking the outputs of compaction stats or compaction history. Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

smadhavan avatar image
smadhavan answered pramod.dba31_92912 commented

@pramod.dba31_92912 , you could refer to the below documentation to understand the options available,

  • nodetool compactionhistory
  • nodetool enableautocompaction|disableautocompaction|compactionstats|getcompactionthreshold|getcompactionthroughput commands
2 comments Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

I am looking for specifically with respect to table. As from the documentations I haven't found any thing relative. So looking if there is any other way or am I missing any thing here.

0 Likes 0 ·
smadhavan avatar image smadhavan ♦ pramod.dba31_92912 ·

You could very much do this to get the stats for a given table within a keyspace,

nodetool <options> getcompactionthreshold -- <keyspace> <table>
0 Likes 0 ·