ClickHouse/clickhouse-docs-embeddings huggingface dataset:
title_wip

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/operations/system-tables/detached_parts.md)

Contains information about detached parts of [MergeTree](/docs/engines/table-engines/mergetree-family/mergetree) tables. The `reason` column specifies why the part was detached.

For user-detached parts, the reason is empty. Such parts can be attached with [ALTER TABLE ATTACH PARTITION|PART](/docs/sql-reference/statements/alter/partition#attach-partitionpart) command.

For the description of other columns, see [system.parts](/docs/operations/system-tables/parts).

If part name is invalid, values of some columns may be `NULL`. Such parts can be deleted with [ALTER TABLE DROP DETACHED PART](/docs/sql-reference/statements/alter/partition#drop-detached-partitionpart).

Was this page helpful?
title_wip

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/operations/system-tables/detached_tables.md)

Contains information of each detached table.

Columns:

- `database` ([String](/docs/sql-reference/data-types)) — The name of the database the table is in.
- `table` ([String](/docs/sql-reference/data-types)) — Table name.
- `uuid` ([UUID](/docs/sql-reference/data-types)) — Table uuid (Atomic database).
- `metadata_path` ([String](/docs/sql-reference/data-types)) — Path to the table metadata in the file system.
- `is_permanently` ([UInt8](/docs/sql-reference/data-types)) — Table was detached permanently.

**Example**

```
SELECT * FROM system.detached_tables FORMAT Vertical;
```

```
Row 1:
──────
database:                   base
table:                      t1
uuid:                       81b1c20a-b7c6-4116-a2ce-7583fb6b6736
metadata_path:              /var/lib/clickhouse/store/461/461cf698-fd0b-406d-8c01-5d8fd5748a91/t1.sql
is_permanently:             1
```

Was this page helpful?
title_wip

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/operations/system-tables/dimensional_metrics.md)

Querying in ClickHouse Cloud

The data in this system table is held locally on each node in ClickHouse Cloud. Obtaining a complete view of all data, therefore, requires the `clusterAllReplicas` function. See [here](/docs/operations/system-tables/overview#system-tables-in-clickhouse-cloud) for further details.

This table contains dimensional metrics that can be calculated instantly and exported in the Prometheus format. It is always up to date.

Columns:

- `metric` ([String](/docs/sql-reference/data-types/string)) — Metric name.
- `value` ([Int64](/docs/sql-reference/data-types/int-uint)) — Metric value.
- `description` ([String](/docs/sql-reference/data-types/string)) — Metric description.
- `labels` ([Map(String, String)](/docs/sql-reference/data-types/map)) — Metric labels.
- `name` ([String](/docs/sql-reference/data-types/string)) — Alias for `metric`.

**Example**

You can use a query like this to export all the dimensional metrics in the Prometheus format.

```
SELECT
  metric AS name,
  toFloat64(value) AS value,
  description AS help,
  labels,
  'gauge' AS type
FROM system.dimensional_metrics
FORMAT Prometheus
```

## Metric descriptions[​](#metric_descriptions "Direct link to Metric descriptions")

### merge\_failures[​](#merge_failures "Direct link to merge_failures")

Number of all failed merges since startup.

### startup\_scripts\_failure\_reason[​](#startup_scripts_failure_reason "Direct link to startup_scripts_failure_reason")

Indicates startup scripts failures by error type. Set to 1 when a startup script fails, labelled with the error name.

### merge\_tree\_parts[​](#merge_tree_parts "Direct link to merge_tree_parts")

Number of merge tree data parts, labelled by part state, part type, and whether it is a projection part.

**See Also**

- [system.asynchronous\_metrics](/docs/operations/system-tables/asynchronous_metrics) — Contains periodically calculated metrics.
- [system.events](/docs/operations/system-tables/events) — Contains a number of events that occurred.
- [system.metric\_log](/docs/operations/system-tables/metric_log) — Contains a history of metrics values from tables `system.metrics` and `system.events`.
- [Monitoring](/docs/operations/monitoring) — Base concepts of ClickHouse monitoring.

- [Metric descriptions](#metric_descriptions)
  - [merge\_failures](#merge_failures)- [startup\_scripts\_failure\_reason](#startup_scripts_failure_reason)- [merge\_tree\_parts](#merge_tree_parts)

Was this page helpful?
title_wip

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/operations/system-tables/disks.md)

Querying in ClickHouse Cloud

The data in this system table is held locally on each node in ClickHouse Cloud. Obtaining a complete view of all data, therefore, requires the `clusterAllReplicas` function. See [here](/docs/operations/system-tables/overview#system-tables-in-clickhouse-cloud) for further details.

Contains information about disks defined in the [server configuration](/docs/engines/table-engines/mergetree-family/mergetree#table_engine-mergetree-multiple-volumes_configure).

Columns:

- `name` ([String](/docs/sql-reference/data-types)) — Name of a disk in the server configuration.
- `path` ([String](/docs/sql-reference/data-types)) — Path to the mount point in the file system.
- `free_space` ([UInt64](/docs/sql-reference/data-types)) — Free space on disk in bytes.
- `total_space` ([UInt64](/docs/sql-reference/data-types)) — Disk volume in bytes.
- `unreserved_space` ([UInt64](/docs/sql-reference/data-types)) — Free space which is not taken by reservations (free\_space minus the size of reservations taken by merges, inserts, and other disk write operations currently running).
- `keep_free_space` ([UInt64](/docs/sql-reference/data-types)) — Amount of disk space that should stay free on disk in bytes. Defined in the keep\_free\_space\_bytes parameter of disk configuration.
- `type` ([String](/docs/sql-reference/data-types)) — The disk type which tells where this disk stores the data - RAM, local drive or remote storage.
- `object_storage_type` ([String](/docs/sql-reference/data-types)) — Type of object storage if disk type is object\_storage
- `metadata_type` ([String](/docs/sql-reference/data-types)) — Type of metadata storage if disk type is object\_storage
- `is_encrypted` ([UInt8](/docs/sql-reference/data-types)) — Flag which shows whether this disk ecrypts the underlying data.
- `is_read_only` ([UInt8](/docs/sql-reference/data-types)) — Flag which indicates that you can only perform read operations with this disk.
- `is_write_once` ([UInt8](/docs/sql-reference/data-types)) — Flag which indicates if disk is write-once. Which means that it does support BACKUP to this disk, but does not support INSERT into MergeTree table on this disk.
- `is_remote` ([UInt8](/docs/sql-reference/data-types)) — Flag which indicated what operations with this disk involve network interaction.
- `is_broken` ([UInt8](/docs/sql-reference/data-types)) — Flag which indicates if disk is broken. Broken disks will have 0 space and cannot be used.
- `cache_path` ([String](/docs/sql-reference/data-types)) — The path to the cache directory on local drive in case when the disk supports caching.

**Example**

```
SELECT * FROM system.disks;
```

```
┌─name────┬─path─────────────────┬───free_space─┬──total_space─┬─keep_free_space─┐
│ default │ /var/lib/clickhouse/ │ 276392587264 │ 490652508160 │               0 │
└─────────┴──────────────────────┴──────────────┴──────────────┴─────────────────┘

1 rows in set. Elapsed: 0.001 sec.
```

Was this page helpful?
title_wip

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/operations/system-tables/distribution_queue.md)

Contains information about local files that are in the queue to be sent to the shards. These local files contain new parts that are created by inserting new data into the Distributed table in asynchronous mode.

Columns:

- `database` ([String](/docs/sql-reference/data-types)) — Name of the database.
- `table` ([String](/docs/sql-reference/data-types)) — Name of the table.
- `data_path` ([String](/docs/sql-reference/data-types)) — Path to the folder with local files.
- `is_blocked` ([UInt8](/docs/sql-reference/data-types)) — Flag indicates whether sending local files to the server is blocked.
- `error_count` ([UInt64](/docs/sql-reference/data-types)) — Number of errors.
- `data_files` ([UInt64](/docs/sql-reference/data-types)) — Number of local files in a folder.
- `data_compressed_bytes` ([UInt64](/docs/sql-reference/data-types)) — Size of compressed data in local files, in bytes.
- `broken_data_files` ([UInt64](/docs/sql-reference/data-types)) — Number of files that has been marked as broken (due to an error).
- `broken_data_compressed_bytes` ([UInt64](/docs/sql-reference/data-types)) — Size of compressed data in broken files, in bytes.
- `last_exception` ([String](/docs/sql-reference/data-types)) — Text message about the last error that occurred (if any).
- `last_exception_time` ([DateTime](/docs/sql-reference/data-types)) — Time when last exception occurred.

**Example**

```
SELECT * FROM system.distribution_queue LIMIT 1 FORMAT Vertical;
```

```
Row 1:
──────
database:              default
table:                 dist
data_path:             ./store/268/268bc070-3aad-4b1a-9cf2-4987580161af/default@127%2E0%2E0%2E2:9000/
is_blocked:            1
error_count:           0
data_files:            1
data_compressed_bytes: 499
last_exception:
```

**See Also**

- [Distributed table engine](/docs/engines/table-engines/special/distributed)

Was this page helpful?
title_wip

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/operations/system-tables/dns_cache.md)

Querying in ClickHouse Cloud

The data in this system table is held locally on each node in ClickHouse Cloud. Obtaining a complete view of all data, therefore, requires the `clusterAllReplicas` function. See [here](/docs/operations/system-tables/overview#system-tables-in-clickhouse-cloud) for further details.

Contains information about cached DNS records.

Columns:

- `hostname` ([String](/docs/sql-reference/data-types)) — Hostname.
- `ip_address` ([String](/docs/sql-reference/data-types)) — IP address.
- `ip_family` ([Enum8('IPv4' = 0, 'IPv6' = 1, 'UNIX\_LOCAL' = 2)](/docs/sql-reference/data-types)) — IP address family.
- `cached_at` ([DateTime](/docs/sql-reference/data-types)) — Record cached timestamp.

**Example**

Query:

```
SELECT * FROM system.dns_cache;
```

Result:

|  |  |  |  |  |  |  |  |  |  |  |  |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| hostname ip\_address ip\_family cached\_at|  |  |  |  |  |  |  |  | | --- | --- | --- | --- | --- | --- | --- | --- | | localhost ::1 IPv6 2024-02-11 17:04:40|  |  |  |  | | --- | --- | --- | --- | | localhost 127.0.0.1 IPv4 2024-02-11 17:04:40 | | | | | | | | | | | |

**See also**

- [disable\_internal\_dns\_cache setting](/docs/operations/server-configuration-parameters/settings#disable_internal_dns_cache)
- [dns\_cache\_max\_entries setting](/docs/operations/server-configuration-parameters/settings#dns_cache_max_entries)
- [dns\_cache\_update\_period setting](/docs/operations/server-configuration-parameters/settings#dns_cache_update_period)
- [dns\_max\_consecutive\_failures setting](/docs/operations/server-configuration-parameters/settings#dns_max_consecutive_failures)

Was this page helpful?
title_wip

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/operations/system-tables/dropped_tables.md)

Contains information about tables that drop table has been executed on but for which data cleanup has not yet been performed.

Columns:

- `index` ([UInt32](/docs/sql-reference/data-types)) — Index in marked\_dropped\_tables queue.
- `database` ([String](/docs/sql-reference/data-types)) — Database name.
- `table` ([String](/docs/sql-reference/data-types)) — Table name.
- `uuid` ([UUID](/docs/sql-reference/data-types)) — Table UUID.
- `engine` ([String](/docs/sql-reference/data-types)) — Table engine name.
- `metadata_dropped_path` ([String](/docs/sql-reference/data-types)) — Path of table's metadata file in metadata\_dropped directory.
- `table_dropped_time` ([DateTime](/docs/sql-reference/data-types)) — The time when the next attempt to remove table's data is scheduled on. Usually it's the table when the table was dropped plus `database_atomic_delay_before_drop_table_sec`.

**Example**

The following example shows how to get information about `dropped_tables`.

```
SELECT *
FROM system.dropped_tables\G
```

```
Row 1:
──────
index:                 0
database:              default
table:                 test
uuid:                  03141bb2-e97a-4d7c-a172-95cc066bb3bd
engine:                MergeTree
metadata_dropped_path: /data/ClickHouse/build/programs/data/metadata_dropped/default.test.03141bb2-e97a-4d7c-a172-95cc066bb3bd.sql
table_dropped_time:    2023-03-16 23:43:31
```

Was this page helpful?
title_wip

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/operations/system-tables/dropped_tables_parts.md)

Contains information about parts of [MergeTree](/docs/engines/table-engines/mergetree-family/mergetree) dropped tables from [system.dropped\_tables](/docs/operations/system-tables/dropped_tables)

The schema of this table is the same as [system.parts](/docs/operations/system-tables/parts)

**See Also**

- [MergeTree family](/docs/engines/table-engines/mergetree-family/mergetree)
- [system.parts](/docs/operations/system-tables/parts)
- [system.dropped\_tables](/docs/operations/system-tables/dropped_tables)

Was this page helpful?
title_wip

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/operations/system-tables/enabled_roles.md)

Contains all active roles at the moment, including the current role of the current user and granted roles for the current role.

Columns:

- `role_name` ([String](/docs/sql-reference/data-types/string))) — Role name.
- `with_admin_option` ([UInt8](/docs/sql-reference/data-types/int-uint#integer-ranges)) — Flag that shows whether `enabled_role` is a role with `ADMIN OPTION` privilege.
- `is_current` ([UInt8](/docs/sql-reference/data-types/int-uint#integer-ranges)) — Flag that shows whether `enabled_role` is a current role of a current user.
- `is_default` ([UInt8](/docs/sql-reference/data-types/int-uint#integer-ranges)) — Flag that shows whether `enabled_role` is a default role.

Was this page helpful?
title_wip

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/operations/system-tables/errors.md)

Querying in ClickHouse Cloud

The data in this system table is held locally on each node in ClickHouse Cloud. Obtaining a complete view of all data, therefore, requires the `clusterAllReplicas` function. See [here](/docs/operations/system-tables/overview#system-tables-in-clickhouse-cloud) for further details.

Contains error codes with the number of times they have been triggered.

To show all possible error codes, including ones which were not triggered, set setting [system\_events\_show\_zero\_values](/docs/operations/settings/settings#system_events_show_zero_values) to 1.

Columns:

- `name` ([String](/docs/sql-reference/data-types)) — Name of the error (errorCodeToName).
- `code` ([Int32](/docs/sql-reference/data-types)) — Code number of the error.
- `value` ([UInt64](/docs/sql-reference/data-types)) — The number of times this error happened.
- `last_error_time` ([DateTime](/docs/sql-reference/data-types)) — The time when the last error happened.
- `last_error_message` ([String](/docs/sql-reference/data-types)) — Message for the last error.
- `last_error_format_string` ([String](/docs/sql-reference/data-types)) — Format string for the last error.
- `last_error_trace` ([Array(UInt64)](/docs/sql-reference/data-types)) — A stack trace that represents a list of physical addresses where the called methods are stored.
- `remote` ([UInt8](/docs/sql-reference/data-types)) — Remote exception (i.e. received during one of the distributed queries).
- `query_id` ([String](/docs/sql-reference/data-types)) — Id of a query that caused an error (if available).

Note

Counters for some errors may increase during successful query execution. It's not recommended to use this table for server monitoring purposes unless you are sure that corresponding error can not be a false positive.

**Example**

```
SELECT name, code, value
FROM system.errors
WHERE value > 0
ORDER BY code ASC
LIMIT 1

┌─name─────────────┬─code─┬─value─┐
│ CANNOT_OPEN_FILE │   76 │     1 │
└──────────────────┴──────┴───────┘
```

```
WITH arrayMap(x -> demangle(addressToSymbol(x)), last_error_trace) AS all
SELECT name, arrayStringConcat(all, '\n') AS res
FROM system.errors
LIMIT 1
SETTINGS allow_introspection_functions=1\G
```

Was this page helpful?
title_wip

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/operations/system-tables/functions.md)

Contains information about normal and aggregate functions.

Columns:

- `name` ([String](/docs/sql-reference/data-types)) — The name of the function.
- `is_aggregate` ([UInt8](/docs/sql-reference/data-types)) — Whether the function is an aggregate function.
- `case_insensitive` ([UInt8](/docs/sql-reference/data-types)) — Whether the function name can be used case-insensitively.
- `alias_to` ([String](/docs/sql-reference/data-types)) — The original function name, if the function name is an alias.
- `create_query` ([String](/docs/sql-reference/data-types)) — Obsolete.
- `origin` ([Enum8('System' = 0, 'SQLUserDefined' = 1, 'ExecutableUserDefined' = 2)](/docs/sql-reference/data-types)) — Obsolete.
- `description` ([String](/docs/sql-reference/data-types)) — A high-level description what the function does.
- `syntax` ([String](/docs/sql-reference/data-types)) — Signature of the function.
- `arguments` ([String](/docs/sql-reference/data-types)) — The function arguments.
- `parameters` ([String](/docs/sql-reference/data-types)) — The function parameters (only for aggregate function).
- `returned_value` ([String](/docs/sql-reference/data-types)) — What does the function return.
- `examples` ([String](/docs/sql-reference/data-types)) — Usage example.
- `introduced_in` ([String](/docs/sql-reference/data-types)) — ClickHouse version in which the function was first introduced.
- `categories` ([String](/docs/sql-reference/data-types)) — The category of the function.

**Example**

```
 SELECT name, is_aggregate, is_deterministic, case_insensitive, alias_to FROM system.functions LIMIT 5;
```

```
┌─name─────────────────────┬─is_aggregate─┬─is_deterministic─┬─case_insensitive─┬─alias_to─┐
│ BLAKE3                   │            0 │                1 │                0 │          │
│ sipHash128Reference      │            0 │                1 │                0 │          │
│ mapExtractKeyLike        │            0 │                1 │                0 │          │
│ sipHash128ReferenceKeyed │            0 │                1 │                0 │          │
│ mapPartialSort           │            0 │                1 │                0 │          │
└──────────────────────────┴──────────────┴──────────────────┴──────────────────┴──────────┘

5 rows in set. Elapsed: 0.002 sec.
```

Was this page helpful?
title_wip

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/operations/system-tables/grants.md)

Privileges granted to ClickHouse user accounts.

Columns:

- `user_name` ([Nullable](/docs/sql-reference/data-types/nullable)([String](/docs/sql-reference/data-types/string))) — User name.
- `role_name` ([Nullable](/docs/sql-reference/data-types/nullable)([String](/docs/sql-reference/data-types/string))) — Role assigned to user account.
- `access_type` ([Enum8](/docs/sql-reference/data-types/enum)) — Access parameters for ClickHouse user account.
- `database` ([Nullable](/docs/sql-reference/data-types/nullable)([String](/docs/sql-reference/data-types/string))) — Name of a database.
- `table` ([Nullable](/docs/sql-reference/data-types/nullable)([String](/docs/sql-reference/data-types/string))) — Name of a table.
- `column` ([Nullable](/docs/sql-reference/data-types/nullable)([String](/docs/sql-reference/data-types/string))) — Name of a column to which access is granted.
- `is_partial_revoke` ([UInt8](/docs/sql-reference/data-types/int-uint#integer-ranges)) — Logical value. It shows whether some privileges have been revoked. Possible values:
- `0` — The row describes a grant.
- `1` — The row describes a partial revoke.
- `grant_option` ([UInt8](/docs/sql-reference/data-types/int-uint#integer-ranges)) — Permission is granted `WITH GRANT OPTION`, see [GRANT](/docs/sql-reference/statements/grant#granting-privilege-syntax).

Was this page helpful?
title_wip

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/operations/system-tables/graphite_retentions.md)

Contains information about parameters [graphite\_rollup](/docs/operations/server-configuration-parameters/settings#graphite) which are used in tables with [\*GraphiteMergeTree](/docs/engines/table-engines/mergetree-family/graphitemergetree) engines.

Columns:

- `config_name` ([String](/docs/sql-reference/data-types)) — graphite\_rollup parameter name.
- `rule_type` ([String](/docs/sql-reference/data-types)) — The rule type. Possible values: RuleTypeAll = 0 - default, with regex, compatible with old scheme; RuleTypePlain = 1 - plain metrics, with regex, compatible with old scheme; RuleTypeTagged = 2 - tagged metrics, with regex, compatible with old scheme; RuleTypeTagList = 3 - tagged metrics, with regex (converted to RuleTypeTagged from string like 'retention=10min ; env=(staging|prod)')
- `regexp` ([String](/docs/sql-reference/data-types)) — A pattern for the metric name.
- `function` ([String](/docs/sql-reference/data-types)) — The name of the aggregating function.
- `age` ([UInt64](/docs/sql-reference/data-types)) — The minimum age of the data in seconds.
- `precision` ([UInt64](/docs/sql-reference/data-types)) — How precisely to define the age of the data in seconds.
- `priority` ([UInt16](/docs/sql-reference/data-types)) — Pattern priority.
- `is_default` ([UInt8](/docs/sql-reference/data-types)) — Whether the pattern is the default.
- `Tables.database` ([Array(String)](/docs/sql-reference/data-types)) — Array of names of database tables that use the `config_name` parameter.
- `Tables.table` ([Array(String)](/docs/sql-reference/data-types)) — Array of table names that use the `config_name` parameter.

Was this page helpful?
histogram_metrics

[keeper\_write\_commit\_time\_milliseconds](#keeper_write_commit_time_milliseconds)- [keeper\_write\_commit\_time\_milliseconds](#keeper_write_commit_time_milliseconds)- [keeper\_write\_commit\_time\_milliseconds](#keeper_write_commit_time_milliseconds)- [keeper\_write\_commit\_time\_milliseconds\_sum](#keeper_write_commit_time_milliseconds_sum)- [keeper\_write\_pre\_commit\_time\_milliseconds](#keeper_write_pre_commit_time_milliseconds)- [keeper\_write\_pre\_commit\_time\_milliseconds](#keeper_write_pre_commit_time_milliseconds)- [keeper\_write\_pre\_commit\_time\_milliseconds](#keeper_write_pre_commit_time_milliseconds)- [keeper\_write\_pre\_commit\_time\_milliseconds](#keeper_write_pre_commit_time_milliseconds)- [keeper\_write\_pre\_commit\_time\_milliseconds](#keeper_write_pre_commit_time_milliseconds)- [keeper\_write\_pre\_commit\_time\_milliseconds](#keeper_write_pre_commit_time_milliseconds)- [keeper\_write\_pre\_commit\_time\_milliseconds](#keeper_write_pre_commit_time_milliseconds)- [keeper\_write\_pre\_commit\_time\_milliseconds](#keeper_write_pre_commit_time_milliseconds)- [keeper\_write\_pre\_commit\_time\_milliseconds\_sum](#keeper_write_pre_commit_time_milliseconds_sum)