Skip to main content

Documentation Index

Fetch the complete documentation index at: https://private-7c7dfe99-page-updates.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Manipulating SAMPLE BY expression

The following operations are available:

MODIFY

ALTER TABLE [db].name [ON CLUSTER cluster] MODIFY SAMPLE BY new_expression
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

ALTER TABLE [db].name [ON CLUSTER cluster] REMOVE SAMPLE BY
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.

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