Background
Partitioning is specified on a table when it is initially defined via thePARTITION BY clause. This clause can contain a SQL expression on any columns, the results of which will define which partition a row is sent to.
The data parts are logically associated with each partition on disk and can be queried in isolation. For the example below, we partition the posts table by year using the expression toYear(CreationDate). As rows are inserted into ClickHouse, this expression will be evaluated against each row and routed to the resulting partition if it exists (if the row is the first for a year, the partition will be created).
Drop partitions
ALTER TABLE ... DROP PARTITION provides a cost-efficient way to drop a whole partition.