ClickHouse/docs/en/sql-reference/statements/alter/skipping-index.md
Diego Nieto 836e14e52b
Update skipping-index.md
Deleted the confusing comment and added implemented as a mutation, like MATERIALIZE INDEX.
2023-01-26 17:23:39 +01:00

1.4 KiB

slug toc_hidden_folder sidebar_position sidebar_label
/en/sql-reference/statements/alter/skipping-index true 42 INDEX

Manipulating Data Skipping Indices

The following operations are available:

  • ALTER TABLE [db].table_name [ON CLUSTER cluster] ADD INDEX name expression TYPE type GRANULARITY value [FIRST|AFTER name] - Adds index description to tables metadata.

  • ALTER TABLE [db].table_name [ON CLUSTER cluster] DROP INDEX name - Removes index description from tables metadata and deletes index files from disk. Implemented as a mutation.

  • ALTER TABLE [db.]table_name [ON CLUSTER cluster] MATERIALIZE INDEX name [IN PARTITION partition_name] - Rebuilds the secondary index name for the specified partition_name. Implemented as a mutation. If IN PARTITION part is omitted then it rebuilds the index for the whole table data.

The first two commands are lightweight in a sense that they only change metadata or remove files.

Also, they are replicated, syncing indices metadata via ZooKeeper.

:::note
Index manipulation is supported only for tables with *MergeTree engine (including replicated variants). :::