Table Settings Manipulations

There is a set of queries to change table settings. You can modify settings or reset them to default values. A single query can change several settings at once.
If a setting with the specified name does not exist, then the query raises an exception.

Syntax

  1. ALTER TABLE [db].name [ON CLUSTER cluster] MODIFY|RESET SETTING ...

Note

These queries can be applied to MergeTree tables only.

MODIFY SETTING

Changes table settings.

Syntax

  1. MODIFY SETTING setting_name=value [, ...]

Example

  1. CREATE TABLE example_table (id UInt32, data String) ENGINE=MergeTree() ORDER BY id;
  2. ALTER TABLE example_table MODIFY SETTING max_part_loading_threads=8, max_parts_in_total=50000;

RESET SETTING

Resets table settings to their default values. If a setting is in a default state, then no action is taken.

Syntax

  1. RESET SETTING setting_name [, ...]

Example

  1. CREATE TABLE example_table (id UInt32, data String) ENGINE=MergeTree() ORDER BY id
  2. SETTINGS max_part_loading_threads=8;
  3. ALTER TABLE example_table RESET SETTING max_part_loading_threads;

See Also