CollapsingMergeTree engine¶
The CollapsingMergeTree
engine inherits from MergeTree and adds the logic of rows collapsing to data parts merge algorithm.
CollapsingMergeTree
asynchronously deletes, or collapses, pairs of rows if all of the fields in a sorting key (ORDER BY
) are equivalent except the particular field Sign
, which can have 1
and -1
values. Rows without a pair are kept. The engine may significantly reduce the volume of storage and increase the efficiency of SELECT
queries.
CollapsingMergeTree parameters¶
sign¶
sign
is the name of the column with the type of row: 1
is a “state” row, -1
is a “cancel” row.
Query clauses¶
When creating a CollapsingMergeTree
table, the same query clauses are required as when creating a MergeTree
table.
Settings¶
For a list of supported settings, see Engine settings.