Introspection functions

## isMergeTreePartCoveredBy[​](#isMergeTreePartCoveredBy "Direct link to isMergeTreePartCoveredBy")

Introduced in: v25.6.0

Function which checks if the part of the first argument is covered by the part of the second argument.

**Syntax**

```
isMergeTreePartCoveredBy(nested_part, covering_part)
```

**Arguments**

- `nested_part` — Name of expected nested part. [`String`](/docs/sql-reference/data-types/string)
- `covering_part` — Name of expected covering part. [`String`](/docs/sql-reference/data-types/string)

**Returned value**

Returns `1` if it covers, `0` otherwise. [`UInt8`](/docs/sql-reference/data-types/int-uint)

**Examples**

**Basic example**

```
WITH 'all_12_25_7_4' AS lhs, 'all_7_100_10_20' AS rhs
SELECT isMergeTreePartCoveredBy(rhs, lhs), isMergeTreePartCoveredBy(lhs, rhs);
```

```
┌─isMergeTreePartCoveredBy(rhs, lhs)─┬─isMergeTreePartCoveredBy(lhs, rhs)─┐
│                                  0 │                                  1 │
└────────────────────────────────────┴────────────────────────────────────┘
```

## logTrace[​](#logTrace "Direct link to logTrace")

Introduced in: v20.12.0

Emits a trace log message to the server log for each [Block](/docs/development/architecture#block).

**Syntax**

```
logTrace(message)
```

**Arguments**

- `message` — Message that is emitted to the server log. [`const String`](/docs/sql-reference/data-types/string)

**Returned value**

Returns `0` always. [`UInt8`](/docs/sql-reference/data-types/int-uint)

**Examples**

**Basic example**

```
SELECT logTrace('logTrace message');
```

```
┌─logTrace('logTrace message')─┐
│                            0 │
└──────────────────────────────┘
```

## mergeTreePartInfo[​](#mergeTreePartInfo "Direct link to mergeTreePartInfo")

Introduced in: v25.6.0

Function that helps to cut the useful values out of the `MergeTree` part name.

**Syntax**

```
mergeTreePartInfo(part_name)
```

**Arguments**

- `part_name` — Name of part to unpack. [`String`](/docs/sql-reference/data-types/string)

**Returned value**

Returns a Tuple with subcolumns: `partition_id`, `min_block`, `max_block`, `level`, `mutation`. [`Tuple`](/docs/sql-reference/data-types/tuple)

**Examples**

**Basic example**

```
WITH mergeTreePartInfo('all_12_25_7_4') AS info
SELECT info.partition_id, info.min_block, info.max_block, info.level, info.mutation;
```

```
┌─info.partition_id─┬─info.min_block─┬─info.max_block─┬─info.level─┬─info.mutation─┐
│ all               │             12 │             25 │          7 │             4 │
└───────────────────┴────────────────┴────────────────┴────────────┴───────────────┘
```

## tid[​](#tid "Direct link to tid")

Introduced in: v20.12.0

Returns id of the thread, in which the current [Block](/docs/development/architecture#block) is processed.

**Syntax**

```
tid()
```

**Arguments**

- None.

**Returned value**

Returns the current thread id. [`UInt64`](/docs/sql-reference/data-types/int-uint)

**Examples**

**Usage example**

```
SELECT tid();
```

```
┌─tid()─┐
│  3878 │
└───────┘
```

- [addressToLine](#addressToLine)- [addressToLineWithInlines](#addressToLineWithInlines)- [addressToSymbol](#addressToSymbol)- [demangle](#demangle)- [isMergeTreePartCoveredBy](#isMergeTreePartCoveredBy)- [logTrace](#logTrace)- [mergeTreePartInfo](#mergeTreePartInfo)- [tid](#tid)

Was this page helpful?