Skip to main content
Skip to main content

Manipulating SAMPLE BY expression

The following operations are available:

MODIFY

The command changes the sampling key of the table to new_expression (an expression or a tuple of expressions). The primary key must contain the new sample key.

REMOVE

The command removes the sampling key of the table.

The commands MODIFY and REMOVE are lightweight in the sense that they only change metadata or remove files.

note

It only works for tables in the MergeTree family (including replicated tables).

Try ClickHouse Cloud for FREE

Separation of storage and compute, automatic scaling, built-in SQL console, and lots more. $300 in free credits when signing up.

Try it for Free