> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-fbfa8bee.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Documentation des fonctions d’introspection

# Fonctions d’introspection

Vous pouvez utiliser les fonctions décrites dans ce chapitre pour inspecter [ELF](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format) et [DWARF](https://en.wikipedia.org/wiki/DWARF) dans le cadre du profilage des requêtes.

<Note>
  Ces fonctions sont lentes et peuvent poser des problèmes de sécurité.
</Note>

Pour que les fonctions d’introspection fonctionnent correctement :

* Installez le paquet `clickhouse-common-static-dbg`.

* Définissez le paramètre [allow\_introspection\_functions](/fr/reference/settings/session-settings#allow_introspection_functions) sur 1.

  Pour des raisons de sécurité, les fonctions d’introspection sont désactivées par défaut.

ClickHouse enregistre les rapports du profileur dans la table système [trace\_log](/fr/reference/system-tables/trace_log). Assurez-vous que la table et le profileur sont correctement configurés.

{/*AUTOGENERATED_START*/}

<div id="addressToLine">
  ## addressToLine
</div>

Introduit dans : v20.1.0

Convertit une adresse de mémoire virtuelle au sein du processus serveur ClickHouse en nom de fichier et numéro de ligne dans le code source de ClickHouse.

<Note>
  Cette fonction est lente et peut avoir des implications en matière de sécurité.
</Note>

Pour activer cette fonction d’introspection :

* Installez le paquet `clickhouse-common-static-dbg`.
* Définissez le paramètre [`allow_introspection_functions`](/fr/reference/settings/session-settings#allow_introspection_functions) sur `1`.

**Syntaxe**

```sql theme={null}
addressToLine(address_of_binary_instruction)
```

**Arguments**

* `address_of_binary_instruction` — Adresse de l’instruction dans un processus en cours d’exécution. [`UInt64`](/fr/reference/data-types/int-uint)

**Valeur renvoyée**

Renvoie un nom de fichier de code source et un numéro de ligne séparés par le caractère deux-points, par exemple `/build/obj-x86_64-linux-gnu/../src/Common/ThreadPool.cpp:199`. Renvoie le nom d’un binaire si aucune information de débogage n’a été trouvée ; sinon, renvoie une chaîne vide si l’adresse n’est pas valide. [`String`](/fr/reference/data-types/string)

**Exemples**

**Sélection de la première chaîne de caractères de la table système `trace_log`**

```sql title=Query theme={null}
SET allow_introspection_functions=1;
SELECT * FROM system.trace_log LIMIT 1 \G;
```

```response title=Response theme={null}
-- The `trace` field contains the stack trace at the moment of sampling.
Row 1:
──────
event_date:              2019-11-19
event_time:              2019-11-19 18:57:23
revision:                54429
timer_type:              Real
thread_number:           48
query_id:                421b6855-1858-45a5-8f37-f383409d6d72
trace:                   [140658411141617,94784174532828,94784076370703,94784076372094,94784076361020,94784175007680,140658411116251,140658403895439]
```

**Récupération du nom du fichier de code source et du numéro de ligne pour une seule adresse**

```sql title=Query theme={null}
SET allow_introspection_functions=1;
SELECT addressToLine(94784076370703) \G;
```

```response title=Response theme={null}
Row 1:
──────
addressToLine(94784076370703): /build/obj-x86_64-linux-gnu/../src/Common/ThreadPool.cpp:199
```

**Application de la fonction à l’intégralité de la pile d’appels**

```sql title=Query theme={null}
-- The arrayMap function in this example processing each individual element of the trace array by the addressToLine function.
-- The result of this processing is seen in the trace_source_code_lines column of output.

SELECT
    arrayStringConcat(arrayMap(x -> addressToLine(x), trace), '\n') AS trace_source_code_lines
FROM system.trace_log
LIMIT 1
\G
```

```response title=Response theme={null}
Row 1:
──────
trace_source_code_lines: /lib/x86_64-linux-gnu/libpthread-2.27.so
/usr/lib/debug/usr/bin/clickhouse
/build/obj-x86_64-linux-gnu/../src/Common/ThreadPool.cpp:199
/build/obj-x86_64-linux-gnu/../src/Common/ThreadPool.h:155
/usr/include/c++/9/bits/atomic_base.h:551
/usr/lib/debug/usr/bin/clickhouse
/lib/x86_64-linux-gnu/libpthread-2.27.so
/build/glibc-OTsEL5/glibc-2.27/misc/../sysdeps/unix/sysv/linux/x86_64/clone.S:97
```

<div id="addressToLineWithInlines">
  ## addressToLineWithInlines
</div>

Introduit dans : v22.2.0

Semblable à `addressToLine`, mais renvoie un Array contenant toutes les fonctions intégrées.
Par conséquent, elle est plus lente que `addressToLine`.

Pour activer cette fonction d’introspection :

* Installez le paquet `clickhouse-common-static-dbg`.
* Définissez le paramètre [`allow_introspection_functions`](/fr/reference/settings/session-settings#allow_introspection_functions) sur `1`.

**Syntaxe**

```sql theme={null}
addressToLineWithInlines(address_of_binary_instruction)
```

**Arguments**

* `address_of_binary_instruction` — L’adresse d’une instruction dans un processus en cours d’exécution. [`UInt64`](/fr/reference/data-types/int-uint)

**Valeur renvoyée**

Renvoie un tableau dont le premier élément est le nom du fichier source et le numéro de ligne, séparés par un deux-points. Les deuxième, troisième, etc. éléments listent les noms des fichiers source, les numéros de ligne et les noms des fonctions inline. Si aucune information de débogage n’a pu être trouvée, un tableau contenant un seul élément correspondant au nom du binaire est renvoyé ; sinon, un tableau vide est renvoyé si l’adresse n’est pas valide. [`Array(String)`](/fr/reference/data-types/array)

**Exemples**

**Application de la fonction à une adresse**

```sql title=Query theme={null}
SET allow_introspection_functions=1;
SELECT addressToLineWithInlines(531055181::UInt64);
```

```response title=Response theme={null}
┌─addressToLineWithInlines(CAST('531055181', 'UInt64'))────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ ['./src/Functions/addressToLineWithInlines.cpp:98','./build_normal_debug/./src/Functions/addressToLineWithInlines.cpp:176:DB::(anonymous namespace)::FunctionAddressToLineWithInlines::implCached(unsigned long) const'] │
└──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
```

**Application de la fonction à l’intégralité de la pile d’appels**

```sql title=Query theme={null}
SET allow_introspection_functions=1;

-- The arrayJoin function will split array to rows

SELECT
    ta, addressToLineWithInlines(arrayJoin(trace) AS ta)
FROM system.trace_log
WHERE
    query_id = '5e173544-2020-45de-b645-5deebe2aae54';
```

```response title=Response theme={null}
┌────────ta─┬─addressToLineWithInlines(arrayJoin(trace))───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ 365497529 │ ['./build_normal_debug/./contrib/libcxx/include/string_view:252']                                                                                                                                                        │
│ 365593602 │ ['./build_normal_debug/./src/Common/Dwarf.cpp:191']                                                                                                                                                                      │
│ 365593866 │ ['./build_normal_debug/./src/Common/Dwarf.cpp:0']                                                                                                                                                                        │
│ 365592528 │ ['./build_normal_debug/./src/Common/Dwarf.cpp:0']                                                                                                                                                                        │
│ 365591003 │ ['./build_normal_debug/./src/Common/Dwarf.cpp:477']                                                                                                                                                                      │
│ 365590479 │ ['./build_normal_debug/./src/Common/Dwarf.cpp:442']                                                                                                                                                                      │
│ 365590600 │ ['./build_normal_debug/./src/Common/Dwarf.cpp:457']                                                                                                                                                                      │
│ 365598941 │ ['./build_normal_debug/./src/Common/Dwarf.cpp:0']                                                                                                                                                                        │
│ 365607098 │ ['./build_normal_debug/./src/Common/Dwarf.cpp:0']                                                                                                                                                                        │
│ 365590571 │ ['./build_normal_debug/./src/Common/Dwarf.cpp:451']                                                                                                                                                                      │
│ 365598941 │ ['./build_normal_debug/./src/Common/Dwarf.cpp:0']                                                                                                                                                                        │
│ 365607098 │ ['./build_normal_debug/./src/Common/Dwarf.cpp:0']                                                                                                                                                                        │
│ 365590571 │ ['./build_normal_debug/./src/Common/Dwarf.cpp:451']                                                                                                                                                                      │
│ 365598941 │ ['./build_normal_debug/./src/Common/Dwarf.cpp:0']                                                                                                                                                                        │
│ 365607098 │ ['./build_normal_debug/./src/Common/Dwarf.cpp:0']                                                                                                                                                                        │
│ 365590571 │ ['./build_normal_debug/./src/Common/Dwarf.cpp:451']                                                                                                                                                                      │
│ 365598941 │ ['./build_normal_debug/./src/Common/Dwarf.cpp:0']                                                                                                                                                                        │
│ 365597289 │ ['./build_normal_debug/./src/Common/Dwarf.cpp:807']                                                                                                                                                                      │
│ 365599840 │ ['./build_normal_debug/./src/Common/Dwarf.cpp:1118']                                                                                                                                                                     │
│ 531058145 │ ['./build_normal_debug/./src/Functions/addressToLineWithInlines.cpp:152']                                                                                                                                                │
│ 531055181 │ ['./src/Functions/addressToLineWithInlines.cpp:98','./build_normal_debug/./src/Functions/addressToLineWithInlines.cpp:176:DB::(anonymous namespace)::FunctionAddressToLineWithInlines::implCached(unsigned long) const'] │
│ 422333613 │ ['./build_normal_debug/./src/Functions/IFunctionAdaptors.h:21']                                                                                                                                                          │
│ 586866022 │ ['./build_normal_debug/./src/Functions/IFunction.cpp:216']                                                                                                                                                               │
│ 586869053 │ ['./build_normal_debug/./src/Functions/IFunction.cpp:264']                                                                                                                                                               │
│ 586873237 │ ['./build_normal_debug/./src/Functions/IFunction.cpp:334']                                                                                                                                                               │
│ 597901620 │ ['./build_normal_debug/./src/Interpreters/ExpressionActions.cpp:601']                                                                                                                                                    │
│ 597898534 │ ['./build_normal_debug/./src/Interpreters/ExpressionActions.cpp:718']                                                                                                                                                    │
│ 630442912 │ ['./build_normal_debug/./src/Processors/Transforms/ExpressionTransform.cpp:23']                                                                                                                                          │
│ 546354050 │ ['./build_normal_debug/./src/Processors/ISimpleTransform.h:38']                                                                                                                                                          │
│ 626026993 │ ['./build_normal_debug/./src/Processors/ISimpleTransform.cpp:89']                                                                                                                                                        │
│ 626294022 │ ['./build_normal_debug/./src/Processors/Executors/ExecutionThreadContext.cpp:45']                                                                                                                                        │
│ 626293730 │ ['./build_normal_debug/./src/Processors/Executors/ExecutionThreadContext.cpp:63']                                                                                                                                        │
│ 626169525 │ ['./build_normal_debug/./src/Processors/Executors/PipelineExecutor.cpp:213']                                                                                                                                             │
│ 626170308 │ ['./build_normal_debug/./src/Processors/Executors/PipelineExecutor.cpp:178']                                                                                                                                             │
│ 626166348 │ ['./build_normal_debug/./src/Processors/Executors/PipelineExecutor.cpp:329']                                                                                                                                             │
│ 626163461 │ ['./build_normal_debug/./src/Processors/Executors/PipelineExecutor.cpp:84']                                                                                                                                              │
│ 626323536 │ ['./build_normal_debug/./src/Processors/Executors/PullingAsyncPipelineExecutor.cpp:85']                                                                                                                                  │
│ 626323277 │ ['./build_normal_debug/./src/Processors/Executors/PullingAsyncPipelineExecutor.cpp:112']                                                                                                                                 │
│ 626323133 │ ['./build_normal_debug/./contrib/libcxx/include/type_traits:3682']                                                                                                                                                       │
│ 626323041 │ ['./build_normal_debug/./contrib/libcxx/include/tuple:1415']                                                                                                                                                             │
└───────────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
```

<div id="addressToSymbol">
  ## addressToSymbol
</div>

Introduit dans : v20.1.0

Convertit une adresse de mémoire virtuelle située dans le processus du serveur ClickHouse en un symbole provenant des fichiers objets de ClickHouse.

**Syntaxe**

```sql theme={null}
addressToSymbol(address_of_binary_instruction)
```

**Arguments**

* `address_of_binary_instruction` — Adresse de l'instruction dans un processus en cours d’exécution. [`UInt64`](/fr/reference/data-types/int-uint)

**Valeur renvoyée**

Renvoie le symbole des fichiers objets de ClickHouse ou une chaîne vide si l’adresse n’est pas valide. [`String`](/fr/reference/data-types/string)

**Exemples**

**Sélection de la première chaîne de la table système `trace_log`**

```sql title=Query theme={null}
SET allow_introspection_functions=1;
SELECT * FROM system.trace_log LIMIT 1 \G;
```

```response title=Response theme={null}
-- The `trace` field contains the stack trace at the moment of sampling.
Row 1:
──────
event_date:    2019-11-20
event_time:    2019-11-20 16:57:59
revision:      54429
timer_type:    Real
thread_number: 48
query_id:      724028bf-f550-45aa-910d-2af6212b94ac
trace:         [94138803686098,94138815010911,94138815096522,94138815101224,94138815102091,94138814222988,94138806823642,94138814457211,94138806823642,94138814457211,94138806823642,94138806795179,94138806796144,94138753770094,94138753771646,94138753760572,94138852407232,140399185266395,140399178045583]
```

**Récupération du symbole pour une seule adresse**

```sql title=Query theme={null}
SET allow_introspection_functions=1;
SELECT addressToSymbol(94138803686098) \G;
```

```response title=Response theme={null}
Row 1:
──────
addressToSymbol(94138803686098): _ZNK2DB24IAggregateFunctionHelperINS_20AggregateFunctionSumImmNS_24AggregateFunctionSumDataImEEEEE19addBatchSinglePlaceEmPcPPKNS_7IColumnEPNS_5ArenaE
```

**Application de la fonction à l’ensemble de la pile d’appels**

```sql title=Query theme={null}
SET allow_introspection_functions=1;

-- The arrayMap function allows to process each individual element of the trace array by the addressToSymbols function.
-- The result of this processing is shown in the trace_symbols column of output.

SELECT
    arrayStringConcat(arrayMap(x -> addressToSymbol(x), trace), '\n') AS trace_symbols
FROM system.trace_log
LIMIT 1
\G
```

```response title=Response theme={null}
Row 1:
──────
trace_symbols: _ZNK2DB24IAggregateFunctionHelperINS_20AggregateFunctionSumImmNS_24AggregateFunctionSumDataImEEEEE19addBatchSinglePlaceEmPcPPKNS_7IColumnEPNS_5ArenaE
_ZNK2DB10Aggregator21executeWithoutKeyImplERPcmPNS0_28AggregateFunctionInstructionEPNS_5ArenaE
_ZN2DB10Aggregator14executeOnBlockESt6vectorIN3COWINS_7IColumnEE13immutable_ptrIS3_EESaIS6_EEmRNS_22AggregatedDataVariantsERS1_IPKS3_SaISC_EERS1_ISE_SaISE_EERb
_ZN2DB10Aggregator14executeOnBlockERKNS_5BlockERNS_22AggregatedDataVariantsERSt6vectorIPKNS_7IColumnESaIS9_EERS6_ISB_SaISB_EERb
_ZN2DB10Aggregator7executeERKSt10shared_ptrINS_17IBlockInputStreamEERNS_22AggregatedDataVariantsE
_ZN2DB27AggregatingBlockInputStream8readImplEv
_ZN2DB17IBlockInputStream4readEv
_ZN2DB26ExpressionBlockInputStream8readImplEv
_ZN2DB17IBlockInputStream4readEv
_ZN2DB26ExpressionBlockInputStream8readImplEv
_ZN2DB17IBlockInputStream4readEv
_ZN2DB28AsynchronousBlockInputStream9calculateEv
_ZNSt17_Function_handlerIFvvEZN2DB28AsynchronousBlockInputStream4nextEvEUlvE_E9_M_invokeERKSt9_Any_data
_ZN14ThreadPoolImplI20ThreadFromGlobalPoolE6workerESt14_List_iteratorIS0_E
_ZZN20ThreadFromGlobalPoolC4IZN14ThreadPoolImplIS_E12scheduleImplIvEET_St8functionIFvvEEiSt8optionalImEEUlvE1_JEEEOS4_DpOT0_ENKUlvE_clEv
_ZN14ThreadPoolImplISt6threadE6workerESt14_List_iteratorIS0_E
execute_native_thread_routine
start_thread
clone
```

<div id="demangle">
  ## demangle
</div>

Introduit dans : v20.1.0

Convertit un symbole en nom de fonction C++.
Le symbole est généralement renvoyé par la fonction `addressToSymbol`.

**Syntaxe**

```sql theme={null}
demangle(symbol)
```

**Arguments**

* `symbol` — Symbole provenant d’un fichier objet. [`String`](/fr/reference/data-types/string)

**Valeur renvoyée**

Renvoie le nom de la fonction C++, ou une chaîne vide si le symbole n’est pas valide. [`String`](/fr/reference/data-types/string)

**Exemples**

**Sélection de la première chaîne de caractères de la table système `trace_log`**

```sql title=Query theme={null}
SELECT * FROM system.trace_log LIMIT 1 \G;
```

```response title=Response theme={null}
-- The `trace` field contains the stack trace at the moment of sampling.
Row 1:
──────
event_date:    2019-11-20
event_time:    2019-11-20 16:57:59
revision:      54429
timer_type:    Real
thread_number: 48
query_id:      724028bf-f550-45aa-910d-2af6212b94ac
trace:         [94138803686098,94138815010911,94138815096522,94138815101224,94138815102091,94138814222988,94138806823642,94138814457211,94138806823642,94138814457211,94138806823642,94138806795179,94138806796144,94138753770094,94138753771646,94138753760572,94138852407232,140399185266395,140399178045583]
```

**Obtenir le nom d’une fonction pour une adresse unique**

```sql title=Query theme={null}
SET allow_introspection_functions=1;
SELECT demangle(addressToSymbol(94138803686098)) \G;
```

```response title=Response theme={null}
Row 1:
──────
demangle(addressToSymbol(94138803686098)): DB::IAggregateFunctionHelper<DB::AggregateFunctionSum<unsigned long, unsigned long, DB::AggregateFunctionSumData<unsigned long> > >::addBatchSinglePlace(unsigned long, char*, DB::IColumn const**, DB::Arena*) const
```

**Appliquer la fonction à l’ensemble de la pile d’appels**

```sql title=Query theme={null}
SET allow_introspection_functions=1;

-- The arrayMap function allows to process each individual element of the trace array by the demangle function.
-- The result of this processing is shown in the trace_functions column of output.

SELECT
    arrayStringConcat(arrayMap(x -> demangle(addressToSymbol(x)), trace), '\n') AS trace_functions
FROM system.trace_log
LIMIT 1
\G
```

```response title=Response theme={null}
Row 1:
──────
trace_functions: DB::IAggregateFunctionHelper<DB::AggregateFunctionSum<unsigned long, unsigned long, DB::AggregateFunctionSumData<unsigned long> > >::addBatchSinglePlace(unsigned long, char*, DB::IColumn const**, DB::Arena*) const
DB::Aggregator::executeWithoutKeyImpl(char*&, unsigned long, DB::Aggregator::AggregateFunctionInstruction*, DB::Arena*) const
DB::Aggregator::executeOnBlock(...)
DB::Aggregator::executeOnBlock(DB::Block const&, ...)
DB::Aggregator::execute(std::shared_ptr<DB::IBlockInputStream> const&, DB::AggregatedDataVariants&)
DB::AggregatingBlockInputStream::readImpl()
DB::IBlockInputStream::read()
DB::ExpressionBlockInputStream::readImpl()
DB::IBlockInputStream::read()
DB::ExpressionBlockInputStream::readImpl()
DB::IBlockInputStream::read()
DB::AsynchronousBlockInputStream::calculate()
std::_Function_handler<void (), DB::AsynchronousBlockInputStream::next()::{lambda()#1}>::_M_invoke(std::_Any_data const&)
ThreadPoolImpl<ThreadFromGlobalPool>::worker(std::_List_iterator<ThreadFromGlobalPool>)
ThreadFromGlobalPool::ThreadFromGlobalPool<ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::function<void ()>, int, std::optional<unsigned long>)::{lambda()#3}>(ThreadPoolImpl<ThreadFromGlobalPool>::scheduleImpl<void>(std::function<void ()>, int, std::optional<unsigned long>)::{lambda()#3}&&)::{lambda()#1}::operator()() const
ThreadPoolImpl<std::thread>::worker(std::_List_iterator<std::thread>)
execute_native_thread_routine
start_thread
clone
```

<div id="isMergeTreePartCoveredBy">
  ## isMergeTreePartCoveredBy
</div>

Introduit dans : v25.6.0

Fonction qui vérifie si la part du premier argument est couverte par la part du second argument.

**Syntaxe**

```sql theme={null}
isMergeTreePartCoveredBy(nested_part, covering_part)
```

**Arguments**

* `nested_part` — Nom de la part imbriquée attendue. [`String`](/fr/reference/data-types/string)
* `covering_part` — Nom de la part couvrante attendue. [`String`](/fr/reference/data-types/string)

**Valeur renvoyée**

Renvoie `1` si elle le couvre, `0` sinon. [`UInt8`](/fr/reference/data-types/int-uint)

**Exemples**

**Exemple de base**

```sql title=Query theme={null}
WITH 'all_12_25_7_4' AS lhs, 'all_7_100_10_20' AS rhs
SELECT isMergeTreePartCoveredBy(rhs, lhs), isMergeTreePartCoveredBy(lhs, rhs);
```

```response title=Response theme={null}
┌─isMergeTreePartCoveredBy(rhs, lhs)─┬─isMergeTreePartCoveredBy(lhs, rhs)─┐
│                                  0 │                                  1 │
└────────────────────────────────────┴────────────────────────────────────┘
```

<div id="logTrace">
  ## logTrace
</div>

Introduit dans : v20.12.0

Émet un message de trace dans le journal du serveur pour chaque [Block](/fr/resources/develop-contribute/introduction/architecture#block).

**Syntaxe**

```sql theme={null}
logTrace(message)
```

**Arguments**

* `message` — Message consigné dans le journal du serveur. [`const String`](/fr/reference/data-types/string)

**Valeur renvoyée**

Renvoie toujours `0`. [`UInt8`](/fr/reference/data-types/int-uint)

**Exemples**

**Exemple de base**

```sql title=Query theme={null}
SELECT logTrace('logTrace message');
```

```response title=Response theme={null}
┌─logTrace('logTrace message')─┐
│                            0 │
└──────────────────────────────┘
```

<div id="mergeTreePartInfo">
  ## mergeTreePartInfo
</div>

Introduit dans : v25.6.0

Fonction qui permet d’extraire les valeurs utiles du nom de la part `MergeTree`.

**Syntaxe**

```sql theme={null}
mergeTreePartInfo(part_name)
```

**Arguments**

* `part_name` — Nom de la part à décompacter. [`String`](/fr/reference/data-types/string)

**Valeur renvoyée**

Renvoie un Tuple comportant les sous-colonnes suivantes : `partition_id`, `min_block`, `max_block`, `level`, `mutation`. [`Tuple`](/fr/reference/data-types/tuple)

**Exemples**

**Exemple de base**

```sql title=Query theme={null}
WITH mergeTreePartInfo('all_12_25_7_4') AS info
SELECT info.partition_id, info.min_block, info.max_block, info.level, info.mutation;
```

```response title=Response theme={null}
┌─info.partition_id─┬─info.min_block─┬─info.max_block─┬─info.level─┬─info.mutation─┐
│ all               │             12 │             25 │          7 │             4 │
└───────────────────┴────────────────┴────────────────┴────────────┴───────────────┘
```

<div id="tid">
  ## tid
</div>

Introduit dans : v20.12.0

Renvoie l’identifiant du thread dans lequel le [Block](/fr/resources/develop-contribute/introduction/architecture#block) actuel est traité.

**Syntaxe**

```sql theme={null}
tid()
```

**Arguments**

* Aucun.

**Valeur renvoyée**

Renvoyer l’identifiant du thread actuel. [`UInt64`](/fr/reference/data-types/int-uint)

**Exemples**

**Exemple d’utilisation**

```sql title=Query theme={null}
SELECT tid();
```

```response title=Response theme={null}
┌─tid()─┐
│  3878 │
└───────┘
```
