ClickHouse/docs/ru/sql-reference/statements/truncate.md
Dmitriy 62b15122ff
DOCSUP-13875: Document the replication_wait_for_inactive_replica_timeout setting (#28464)
* Add documentation of settings

Задокументировал две настройки.

* Fix links

Поправил ссылки.

* Update docs/en/operations/settings/settings.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>

* Update docs/en/operations/settings/settings.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>

* Update docs/en/operations/settings/settings.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>

* Update docs/en/operations/settings/settings.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>

* Update docs/en/sql-reference/statements/alter/index.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>

* Update docs/en/sql-reference/statements/alter/index.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>

* Update docs/en/sql-reference/statements/optimize.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>

* Update docs/en/sql-reference/statements/truncate.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>

* Update docs/en/sql-reference/statements/truncate.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>

* Translate to Russian

Выполнил перевод на русский язык.

* Fix links

Поправил ссылки.

* Update settings.md

Поправил перевод.

* Update docs/en/operations/settings/settings.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>

* Update docs/en/sql-reference/statements/alter/index.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>

* Update docs/en/sql-reference/statements/optimize.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>

* Update docs/en/sql-reference/statements/truncate.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>

* Update docs/ru/operations/settings/settings.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>

* Update docs/ru/operations/settings/settings.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>

* Update docs/en/operations/settings/settings.md

Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>

* Fix errors

Исправил неточности в описании.

* Update optimize.md

Поправил описание запроса OPTIMIZE.

Co-authored-by: Dmitriy <sevirov@yandex-team.ru>
Co-authored-by: olgarev <56617294+olgarev@users.noreply.github.com>
2021-09-09 23:33:08 +03:00

22 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
toc_priority: 51
toc_title: TRUNCATE
---
# TRUNCATE {#truncate-statement}
``` sql
TRUNCATE TABLE [IF EXISTS] [db.]name [ON CLUSTER cluster]
```
Удаляет все данные из таблицы. Если условие `IF EXISTS` не указано, запрос вернет ошибку, если таблицы не существует.
Запрос `TRUNCATE` не поддерживается для следующих движков: [View](../../engines/table-engines/special/view.md), [File](../../engines/table-engines/special/file.md), [URL](../../engines/table-engines/special/url.md), [Buffer](../../engines/table-engines/special/buffer.md) и [Null](../../engines/table-engines/special/null.md).
Вы можете настроить ожидание выполнения действий на репликах с помощью настройки [replication_alter_partitions_sync](../../operations/settings/settings.md#replication-alter-partitions-sync).
Вы можете указать время ожидания (в секундах) выполнения запросов `TRUNCATE` для неактивных реплик с помощью настройки [replication_wait_for_inactive_replica_timeout](../../operations/settings/settings.md#replication-wait-for-inactive-replica-timeout).
!!! info "Примечание"
Если значение настройки `replication_alter_partitions_sync` равно `2` и некоторые реплики не активны больше времени, заданного настройкой `replication_wait_for_inactive_replica_timeout`, то генерируется исключение `UNFINISHED`.