Gary Richardson
Gary Richardson

Reputation: 16441

How do I drop a table and reclaim the space in Cassandra 2.0?

There are all sorts of conflicting methods on the internet to drop a table and reclaim the space in Cassandra 2.0. Some say drop, then delete the data off of disk manually, others say truncate and then drop. Most of the pages are actually about 1.0/1.1/1.2

If I have a table on a Cassandra 2.0.x host with all the nodes up, how do I drop the table AND delete all the data at the same time?

Upvotes: 4

Views: 2094

Answers (1)

RussS
RussS

Reputation: 16576

2.0 Best solution

Truncate
Drop keyspace
Remove folder from disk

The truncate is to attempt to avoid DROP/RECREATE issues and zombie data coming back. In any case once you've dropped a keyspace it's best not to reuse that name. A fix for DROP/RECREATE is coming in 2.1.

Upvotes: 5

Related Questions