Search code examples
clickhouse

When is data really deleted in Clickhouse with the new `DELETE` query


Clickhouse recently released the new DELETE query, that allows you to quickly mark data as deleted (https://clickhouse.com/docs/en/sql-reference/statements/delete/). The actual data deletion is done in the background afterwards, as is written in the docs.

My question is, is there some indication to when data would be deleted? Or is there a way to make sure it gets deleted? I'm asking for GDPR compliance purposes.

Thanks


Solution

  • According to CH support on slack: If using the DELETE query, the only way to make sure data is deleted is to use the OPTIMIZE FINAL query. This would trigger a merge and the deleted data won't be included in the outcome