ClickHouse/clickhouse-docs-embeddings huggingface dataset:
title_wip

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

This system table contain the snapshot history of Iceberg tables existing in ClickHouse. It will be empty if you don't have any Iceberg table in ClickHouse.

Columns:

- `database` ([String](/docs/sql-reference/data-types)) — Database name.
- `table` ([String](/docs/sql-reference/data-types)) — Table name.
- `made_current_at` ([Nullable(DateTime64(3))](/docs/sql-reference/data-types)) — Date & time when this snapshot was made current snapshot
- `snapshot_id` ([UInt64](/docs/sql-reference/data-types)) — Snapshot id which is used to identify a snapshot.
- `parent_id` ([UInt64](/docs/sql-reference/data-types)) — Parent id of this snapshot.
- `is_current_ancestor` ([UInt8](/docs/sql-reference/data-types)) — Flag that indicates if this snapshot is an ancestor of the current snapshot.

Was this page helpful?
title_wip

## STATISTICS[​](#statistics "Direct link to STATISTICS")

Provides information about table indexes. Currently returns an empty result (no rows) which is just enough to provide compatibility with 3rd party tools like Tableau Online.

Columns:

- `table_catalog` ([String](/docs/sql-reference/data-types/string)) — Currently unused.
- `table_schema` ([String](/docs/sql-reference/data-types/string)) — Currently unused.
- `table_name` ([String](/docs/sql-reference/data-types/string)) — Currently unused.
- `non_unique` ([Int32](/docs/sql-reference/data-types/int-uint)) — Currently unused.
- `index_schema` ([String](/docs/sql-reference/data-types/string)) — Currently unused.
- `index_name` ([Nullable](/docs/sql-reference/data-types/nullable)([String](/docs/sql-reference/data-types/string))) — Currently unused.
- `seq_in_index` ([UInt32](/docs/sql-reference/data-types/int-uint)) — Currently unused.
- `column_name` ([Nullable](/docs/sql-reference/data-types/nullable)([String](/docs/sql-reference/data-types/string))) — Currently unused.
- `collation` ([Nullable](/docs/sql-reference/data-types/nullable)([String](/docs/sql-reference/data-types/string))) — Currently unused.
- `cardinality` ([Nullable](/docs/sql-reference/data-types/nullable)([Int64](/docs/sql-reference/data-types/int-uint))) — Currently unused.
- `sub_part` ([Nullable](/docs/sql-reference/data-types/nullable)([Int64](/docs/sql-reference/data-types/int-uint))) — Currently unused.
- `packed` ([Nullable](/docs/sql-reference/data-types/nullable)([String](/docs/sql-reference/data-types/string))) — Currently unused.
- `nullable` ([String](/docs/sql-reference/data-types/string)) — Currently unused.
- `index_type` ([String](/docs/sql-reference/data-types/string)) — Currently unused.
- `comment` ([String](/docs/sql-reference/data-types/string)) — Currently unused.
- `index_comment` ([String](/docs/sql-reference/data-types/string)) — Currently unused.
- `is_visible` ([String](/docs/sql-reference/data-types/string)) — Currently unused.
- `expression` ([Nullable](/docs/sql-reference/data-types/nullable)([String](/docs/sql-reference/data-types/string))) — Currently unused.

- [COLUMNS](#columns)- [SCHEMATA](#schemata)- [TABLES](#tables)- [VIEWS](#views)- [KEY\_COLUMN\_USAGE](#key_column_usage)- [REFERENTIAL\_CONSTRAINTS](#referential_constraints)- [STATISTICS](#statistics)

Was this page helpful?
title_wip

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/operations/system-tables/instrumentation.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 the instrumentation points using LLVM's XRay feature.

Columns:

- `id` ([UInt32](/docs/sql-reference/data-types/int-uint)) — ID of the instrumentation point.
- `function_id` ([Int32](/docs/sql-reference/data-types/int-uint)) — ID assigned to the function in the `xray_instr_map` section of the ELF binary.
- `function_name` ([LowCardinality(String)](/docs/sql-reference/data-types/string)) — Name used to instrument the function.
- `handler` ([LowCardinality(String)](/docs/sql-reference/data-types/string)) — Handler type.
- `entry_type` ([Enum('Entry' = 0, 'Exit' = 1, 'EntryAndExit' = 2)](/docs/sql-reference/data-types/enum)) — Entry type: `Entry`, `Exit` or `EntryAndExit`.
- `symbol` ([LowCardinality(String)](/docs/sql-reference/data-types/string)) — Complete and demangled symbol.
- `parameters` ([Array(Dynamic)](/docs/sql-reference/data-types/array)) — Parameters for the handler call.

**Example**

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

```
Row 1:
──────
id:            0
function_id:   231280
function_name: QueryMetricLog::startQuery
handler:       log
entry_type:    Entry
symbol:        DB::QueryMetricLog::startQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000l>>>, unsigned long)
parameters:    ['test']

Row 2:
──────
id:            1
function_id:   231280
function_name: QueryMetricLog::startQuery
handler:       profile
entry_type:    EntryAndExit
symbol:        DB::QueryMetricLog::startQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000l>>>, unsigned long)
parameters:    []

Row 3:
──────
id:            2
function_id:   231280
function_name: QueryMetricLog::startQuery
handler:       sleep
entry_type:    Exit
symbol:        DB::QueryMetricLog::startQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>> const&, std::__1::chrono::time_point<std::__1::chrono::system_clock, std::__1::chrono::duration<long long, std::__1::ratio<1l, 1000000l>>>, unsigned long)
parameters:    [0.3]

3 rows in set. Elapsed: 0.302 sec.
```

**See also**

- [SYSTEM INSTRUMENT](/docs/sql-reference/statements/system#instrument) — Add or remove instrumentation points.
- [system.trace\_log](/docs/operations/system-tables/trace_log) — Inspect profiling log.
- [system.symbols](/docs/operations/system-tables/symbols) — Inspect symbols to add instrumentation points.

Was this page helpful?
[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/operations/system-tables/jemalloc_bins.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 memory allocations done via jemalloc allocator in different size classes (bins) aggregated from all arenas.
These statistics might not be absolutely accurate because of thread local caching in jemalloc.

Columns:

- `index` ([UInt16](/docs/sql-reference/data-types)) — Index of the bin ordered by size.
- `large` ([UInt8](/docs/sql-reference/data-types)) — True for large allocations and False for small.
- `size` ([UInt64](/docs/sql-reference/data-types)) — Size of allocations in this bin.
- `allocations` ([Int64](/docs/sql-reference/data-types)) — Number of allocations.
- `deallocations` ([Int64](/docs/sql-reference/data-types)) — Number of deallocations.
- `nregs` ([Int64](/docs/sql-reference/data-types)) — Number of regions per slab.
- `curslabs` ([Int64](/docs/sql-reference/data-types)) — Current number of slabs.
- `curregs` ([Int64](/docs/sql-reference/data-types)) — Current number of regions for this size class.

**Example**

Find the sizes of allocations that contributed the most to the current overall memory usage.

```
SELECT
    *,
    allocations - deallocations AS active_allocations,
    size * active_allocations AS allocated_bytes
FROM system.jemalloc_bins
WHERE allocated_bytes > 0
ORDER BY allocated_bytes DESC
LIMIT 10
```

```
┌─index─┬─large─┬─────size─┬─allocactions─┬─deallocations─┬─active_allocations─┬─allocated_bytes─┐
│    82 │     1 │ 50331648 │            1 │             0 │                  1 │        50331648 │
│    10 │     0 │      192 │       512336 │        370710 │             141626 │        27192192 │
│    69 │     1 │  5242880 │            6 │             2 │                  4 │        20971520 │
│     3 │     0 │       48 │     16938224 │      16559484 │             378740 │        18179520 │
│    28 │     0 │     4096 │       122924 │        119142 │               3782 │        15491072 │
│    61 │     1 │  1310720 │        44569 │         44558 │                 11 │        14417920 │
│    39 │     1 │    28672 │         1285 │           913 │                372 │        10665984 │
│     4 │     0 │       64 │      2837225 │       2680568 │             156657 │        10026048 │
│     6 │     0 │       96 │      2617803 │       2531435 │              86368 │         8291328 │
│    36 │     1 │    16384 │        22431 │         21970 │                461 │         7553024 │
└───────┴───────┴──────────┴──────────────┴───────────────┴────────────────────┴─────────────────┘
```

Was this page helpful?
title_wip

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

Contains licenses of third-party libraries that are located in the [contrib](https://github.com/ClickHouse/ClickHouse/tree/master/contrib) directory of ClickHouse sources.

Columns:

- `library_name` ([String](/docs/sql-reference/data-types)) — Name of the library.
- `license_type` ([String](/docs/sql-reference/data-types)) — License type — e.g. Apache, MIT.
- `license_path` ([String](/docs/sql-reference/data-types)) — Path to the file with the license text.
- `license_text` ([String](/docs/sql-reference/data-types)) — License text.

**Example**

```
SELECT library_name, license_type, license_path FROM system.licenses LIMIT 15
```

```
┌─library_name───────┬─license_type─┬─license_path────────────────────────┐
│ aws-c-common       │ Apache       │ /contrib/aws-c-common/LICENSE       │
│ base64             │ BSD 2-clause │ /contrib/aklomp-base64/LICENSE      │
│ brotli             │ MIT          │ /contrib/brotli/LICENSE             │
│ [...]              │ [...]        │ [...]                               │
└────────────────────┴──────────────┴─────────────────────────────────────┘
```

Was this page helpful?
title_wip

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

ClickHouse Cloud only

Contains information about all masking policies defined in the system.

Columns:

- `name` ([String](/docs/sql-reference/data-types/string)) — Name of a masking policy. The full name format is `short_name ON database.table`.
- `short_name` ([String](/docs/sql-reference/data-types/string)) — Short name of a masking policy. For example, if the full name is `mask_email ON mydb.mytable`, the short name is `mask_email`.
- `database` ([String](/docs/sql-reference/data-types/string)) — Database name.
- `table` ([String](/docs/sql-reference/data-types/string)) — Table name.
- `id` ([UUID](/docs/sql-reference/data-types/uuid)) — Masking policy ID.
- `storage` ([String](/docs/sql-reference/data-types/string)) — Name of the directory where the masking policy is stored.
- `update_assignments` ([Nullable(String)](/docs/sql-reference/data-types/nullable)) — UPDATE assignments that define how data should be masked. For example: `email = '***masked***', phone = '***-***-****'`.
- `where_condition` ([Nullable(String)](/docs/sql-reference/data-types/nullable)) — Optional WHERE condition that specifies when the masking should be applied.
- `priority` ([Int64](/docs/sql-reference/data-types/int-uint)) — Priority for applying multiple masking policies. Higher priority policies are applied first. Default is 0.
- `apply_to_all` ([UInt8](/docs/sql-reference/data-types/int-uint)) — Shows whether the masking policy applies to all roles and/or users. 1 if true, 0 otherwise.
- `apply_to_list` ([Array(String)](/docs/sql-reference/data-types/array)) — List of the roles and/or users to which the masking policy is applied.
- `apply_to_except` ([Array(String)](/docs/sql-reference/data-types/array)) — The masking policy is applied to all roles and/or users except the listed ones. Only populated when `apply_to_all` is 1.

Was this page helpful?
title_wip

[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/operations/system-tables/merges.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 merges and part mutations currently in process for tables in the MergeTree family.

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.
- `elapsed` ([Float64](/docs/sql-reference/data-types)) — The time elapsed (in seconds) since the merge started.
- `progress` ([Float64](/docs/sql-reference/data-types)) — The percentage of completed work from 0 to 1.
- `num_parts` ([UInt64](/docs/sql-reference/data-types)) — The number of parts to be merged.
- `source_part_names` ([Array(String)](/docs/sql-reference/data-types)) — The list of source parts names.
- `result_part_name` ([String](/docs/sql-reference/data-types)) — The name of the part that will be formed as the result of merging.
- `source_part_paths` ([Array(String)](/docs/sql-reference/data-types)) — The list of paths for each source part.
- `result_part_path` ([String](/docs/sql-reference/data-types)) — The path of the part that will be formed as the result of merging.
- `partition_id` ([String](/docs/sql-reference/data-types)) — The identifier of the partition where the merge is happening.
- `partition` ([String](/docs/sql-reference/data-types)) — The name of the partition
- `is_mutation` ([UInt8](/docs/sql-reference/data-types)) — 1 if this process is a part mutation.
- `total_size_bytes_compressed` ([UInt64](/docs/sql-reference/data-types)) — The total size of the compressed data in the merged chunks.
- `total_size_bytes_uncompressed` ([UInt64](/docs/sql-reference/data-types)) — The total size of compressed data in the merged chunks.
- `total_size_marks` ([UInt64](/docs/sql-reference/data-types)) — The total number of marks in the merged parts.
- `bytes_read_uncompressed` ([UInt64](/docs/sql-reference/data-types)) — Number of bytes read, uncompressed.
- `rows_read` ([UInt64](/docs/sql-reference/data-types)) — Number of rows read.
- `bytes_written_uncompressed` ([UInt64](/docs/sql-reference/data-types)) — Number of bytes written, uncompressed.
- `rows_written` ([UInt64](/docs/sql-reference/data-types)) — Number of rows written.
- `columns_written` ([UInt64](/docs/sql-reference/data-types)) — Number of columns written (for Vertical merge algorithm).
- `memory_usage` ([UInt64](/docs/sql-reference/data-types)) — Memory consumption of the merge process.
- `thread_id` ([UInt64](/docs/sql-reference/data-types)) — Thread ID of the merge process.
- `merge_type` ([String](/docs/sql-reference/data-types)) — The type of current merge. Empty if it's an mutation.
- `merge_algorithm` ([String](/docs/sql-reference/data-types)) — The algorithm used in current merge. Empty if it's an mutation.

Was this page helpful?
title_wip

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

The table contains information about in-progress [data part moves](/docs/sql-reference/statements/alter/partition#move-partitionpart) of [MergeTree](/docs/engines/table-engines/mergetree-family/mergetree) tables. Each data part movement is represented by a single row.

Columns:

- `database` ([String](/docs/sql-reference/data-types)) — Name of the database.
- `table` ([String](/docs/sql-reference/data-types)) — Name of the table containing moving data part.
- `elapsed` ([Float64](/docs/sql-reference/data-types)) — Time elapsed (in seconds) since data part movement started.
- `target_disk_name` ([String](/docs/sql-reference/data-types)) — Name of disk to which the data part is moving.
- `target_disk_path` ([String](/docs/sql-reference/data-types)) — Path to the mount point of the disk in the file system.
- `part_name` ([String](/docs/sql-reference/data-types)) — Name of the data part being moved.
- `part_size` ([UInt64](/docs/sql-reference/data-types)) — Data part size.
- `thread_id` ([UInt64](/docs/sql-reference/data-types)) — Identifier of a thread performing the movement.

**Example**

```
SELECT * FROM system.moves
```

```
┌─database─┬─table─┬─────elapsed─┬─target_disk_name─┬─target_disk_path─┬─part_name─┬─part_size─┬─thread_id─┐
│ default  │ test2 │ 1.668056039 │ s3               │ ./disks/s3/      │ all_3_3_0 │       136 │    296146 │
└──────────┴───────┴─────────────┴──────────────────┴──────────────────┴───────────┴───────────┴───────────┘
```

**See Also**

- [MergeTree](/docs/engines/table-engines/mergetree-family/mergetree) table engine
- [Using Multiple Block Devices for Data Storage](/docs/engines/table-engines/mergetree-family/mergetree#table_engine-mergetree-multiple-volumes)
- [ALTER TABLE ... MOVE PART](/docs/sql-reference/statements/alter/partition#move-partitionpart) command

Was this page helpful?
title_wip

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

This table contains a single UInt64 column named `number` that contains almost all the natural numbers starting from zero.

You can use this table for tests, or if you need to do a brute force search.

Reads from this table are not parallelized.

**Example**

```
SELECT * FROM system.numbers LIMIT 10;
```

```
┌─number─┐
│      0 │
│      1 │
│      2 │
│      3 │
│      4 │
│      5 │
│      6 │
│      7 │
│      8 │
│      9 │
└────────┘

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

You can also limit the output by predicates.

```
SELECT * FROM system.numbers WHERE number < 10;
```

```
┌─number─┐
│      0 │
│      1 │
│      2 │
│      3 │
│      4 │
│      5 │
│      6 │
│      7 │
│      8 │
│      9 │
└────────┘

10 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/numbers_mt.md)

The same as [`system.numbers`](/docs/operations/system-tables/numbers) but reads are parallelized. The numbers can be returned in any order.

Used for tests.

**Example**

```
SELECT * FROM system.numbers_mt LIMIT 10;
```

```
┌─number─┐
│      0 │
│      1 │
│      2 │
│      3 │
│      4 │
│      5 │
│      6 │
│      7 │
│      8 │
│      9 │
└────────┘

10 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/one.md)

This table contains a single row with a single `dummy` UInt8 column containing the value 0.

This table is used if a `SELECT` query does not specify the `FROM` clause.

This is similar to the `DUAL` table found in other DBMSs.

**Example**

```
SELECT * FROM system.one LIMIT 10;
```

```
┌─dummy─┐
│     0 │
└───────┘

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

Was this page helpful?
title_wip

The `system.part_log` table is created after the first inserting data to the `MergeTree` table.

**Example**

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

```
Row 1:
──────
hostname:                clickhouse.eu-central1.internal
query_id:
event_type:              MergeParts
merge_reason:            RegularMerge
merge_algorithm:         Vertical
event_date:              2025-07-19
event_time:              2025-07-19 23:54:19
event_time_microseconds: 2025-07-19 23:54:19.710761
duration_ms:             2158
database:                default
table:                   github_events
table_uuid:              1ad33424-f5f5-402b-ac03-ec82282634ab
part_name:               all_1_7_1
partition_id:            all
partition:               tuple()
part_type:               Wide
disk_name:               default
path_on_disk:            ./data/store/1ad/1ad33424-f5f5-402b-ac03-ec82282634ab/all_1_7_1/
rows:                    3285726 -- 3.29 million
size_in_bytes:           438968542 -- 438.97 million
merged_from:             ['all_1_1_0','all_2_2_0','all_3_3_0','all_4_4_0','all_5_5_0','all_6_6_0','all_7_7_0']
bytes_uncompressed:      1373137767 -- 1.37 billion
read_rows:               3285726 -- 3.29 million
read_bytes:              1429206946 -- 1.43 billion
peak_memory_usage:       303611887 -- 303.61 million
error:                   0
exception:
mutation_ids:
ProfileEvents:           {'FileOpen':703,'ReadBufferFromFileDescriptorRead':3824,'ReadBufferFromFileDescriptorReadBytes':439601681,'WriteBufferFromFileDescriptorWrite':592,'WriteBufferFromFileDescriptorWriteBytes':438988500,'ReadCompressedBytes':439601681,'CompressedReadBufferBlocks':6314,'CompressedReadBufferBytes':1539835748,'OpenedFileCacheHits':50,'OpenedFileCacheMisses':484,'OpenedFileCacheMicroseconds':222,'IOBufferAllocs':1914,'IOBufferAllocBytes':319810140,'ArenaAllocChunks':8,'ArenaAllocBytes':131072,'MarkCacheMisses':7,'CreatedReadBufferOrdinary':534,'DiskReadElapsedMicroseconds':139058,'DiskWriteElapsedMicroseconds':51639,'AnalyzePatchRangesMicroseconds':28,'ExternalProcessingFilesTotal':1,'RowsReadByMainReader':170857759,'WaitMarksLoadMicroseconds':988,'LoadedMarksFiles':7,'LoadedMarksCount':14,'LoadedMarksMemoryBytes':728,'Merge':2,'MergeSourceParts':14,'MergedRows':3285733,'MergedColumns':4,'GatheredColumns':51,'MergedUncompressedBytes':1429207058,'MergeTotalMilliseconds':2158,'MergeExecuteMilliseconds':2155,'MergeHorizontalStageTotalMilliseconds':145,'MergeHorizontalStageExecuteMilliseconds':145,'MergeVerticalStageTotalMilliseconds':2008,'MergeVerticalStageExecuteMilliseconds':2006,'MergeProjectionStageTotalMilliseconds':5,'MergeProjectionStageExecuteMilliseconds':4,'MergingSortedMilliseconds':7,'GatheringColumnMilliseconds':56,'ContextLock':2091,'PartsLockHoldMicroseconds':77,'PartsLockWaitMicroseconds':1,'RealTimeMicroseconds':2157475,'CannotWriteToWriteBufferDiscard':36,'LogTrace':6,'LogDebug':59,'LoggerElapsedNanoseconds':514040,'ConcurrencyControlSlotsGranted':53,'ConcurrencyControlSlotsAcquired':53}
```

Was this page helpful?