Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fully delete data from Clickhouse DB to save disk space

In order to free up disk space, I've gotten rid of a number of old tables in a clickhouse database via

DROP TABLE mydb.mytable

However, disk usage did not change at all. In particular I expected /var/lib/clickhouse/data/store to shrink.

What am I missing here? Is there a "postgresql.vacuum"-equivalent in clickhouse I should be doing?

like image 414
bleutner Avatar asked Oct 29 '25 07:10

bleutner


1 Answers

Atomic databases keep dropped tables for 8 minutes.

You can use DROP TABLE mydb.mytable no delay

https://kb.altinity.com/engines/altinity-kb-atomic-database-engine

like image 175
Denny Crane Avatar answered Oct 30 '25 23:10

Denny Crane