diff --git a/docs/en/engines/database-engines/replicated.md b/docs/en/engines/database-engines/replicated.md index ed8406e6a86..5ce73604207 100644 --- a/docs/en/engines/database-engines/replicated.md +++ b/docs/en/engines/database-engines/replicated.md @@ -1,3 +1,8 @@ +--- +toc_priority: 36 +toc_title: Replicated +--- + # [experimental] Replicated {#replicated} The engine is based on the [Atomic](../../engines/database-engines/atomic.md) engine. It supports replication of metadata via DDL log being written to ZooKeeper and executed on all of the replicas for a given database. diff --git a/docs/en/sql-reference/statements/explain.md b/docs/en/sql-reference/statements/explain.md index 0ab2cedd73e..9afea708d16 100644 --- a/docs/en/sql-reference/statements/explain.md +++ b/docs/en/sql-reference/statements/explain.md @@ -384,5 +384,32 @@ ExpressionTransform (ReadFromStorage) NumbersMt × 2 0 → 1 ``` +### EXPLAIN ESTIMATE {#explain-estimate} + +Shows the estimated number of rows, marks and parts to be read from the tables while processing the query. Works with tables in the [MergeTree](../../engines/table-engines/mergetree-family/mergetree.md#table_engines-mergetree) family. + +**Example** + +Creating a table: + +```sql +CREATE TABLE ttt (i Int64) ENGINE = MergeTree() ORDER BY i SETTINGS index_granularity = 16, write_final_mark = 0; +INSERT INTO ttt SELECT number FROM numbers(128); +OPTIMIZE TABLE ttt; +``` + +Query: + +```sql +EXPLAIN ESTIMATE SELECT * FROM ttt; +``` + +Result: + +```text +┌─database─┬─table─┬─parts─┬─rows─┬─marks─┐ +│ default │ ttt │ 1 │ 128 │ 8 │ +└──────────┴───────┴───────┴──────┴───────┘ +``` [Оriginal article](https://clickhouse.tech/docs/en/sql-reference/statements/explain/) diff --git a/docs/ru/engines/database-engines/replicated.md b/docs/ru/engines/database-engines/replicated.md index f1d5755647a..b4850a8dafd 100644 --- a/docs/ru/engines/database-engines/replicated.md +++ b/docs/ru/engines/database-engines/replicated.md @@ -1,3 +1,7 @@ +--- +toc_priority: 36 +toc_title: Replicated +--- # [экспериментальный] Replicated {#replicated} diff --git a/docs/ru/sql-reference/statements/explain.md b/docs/ru/sql-reference/statements/explain.md index c11c33ae99a..7a028b31a12 100644 --- a/docs/ru/sql-reference/statements/explain.md +++ b/docs/ru/sql-reference/statements/explain.md @@ -385,4 +385,32 @@ ExpressionTransform NumbersMt × 2 0 → 1 ``` +### EXPLAIN ESTIMATE {#explain-estimate} + + Отображает оценки числа строк, засечек и кусков, которые будут прочитаны при выполнении запроса. Применяется для таблиц семейства [MergeTree](../../engines/table-engines/mergetree-family/mergetree.md#table_engines-mergetree). + +**Пример** + +Создадим таблицу: + +```sql +CREATE TABLE ttt (i Int64) ENGINE = MergeTree() ORDER BY i SETTINGS index_granularity = 16, write_final_mark = 0; +INSERT INTO ttt SELECT number FROM numbers(128); +OPTIMIZE TABLE ttt; +``` + +Запрос: + +```sql +EXPLAIN ESTIMATE SELECT * FROM ttt; +``` + +Результат: + +```text +┌─database─┬─table─┬─parts─┬─rows─┬─marks─┐ +│ default │ ttt │ 1 │ 128 │ 8 │ +└──────────┴───────┴───────┴──────┴───────┘ +``` + [Оригинальная статья](https://clickhouse.tech/docs/ru/sql-reference/statements/explain/)