Skip to main content
You can use functions described in this chapter to introspect ELF and DWARF for query profiling.
These functions are slow and may impose security considerations.
For proper operation of introspection functions:
  • Install the clickhouse-common-static-dbg package.
  • Set the allow_introspection_functions setting to 1. For security reasons introspection functions are disabled by default.
ClickHouse saves profiler reports to the trace_log system table. Make sure the table and profiler are configured properly.

addressToLine

Introduced in: v20.1.0 Converts a virtual memory address inside the ClickHouse server process to a filename and line number in ClickHouse’s source code.
This function is slow and may impose security considerations.
To enable this introspection function: Syntax
Arguments
  • address_of_binary_instruction — Address of instruction in a running process. UInt64
Returned value Returns a source code filename and line number delimited by a colon, for example, /build/obj-x86_64-linux-gnu/../src/Common/ThreadPool.cpp:199. Returns the name of a binary, if no debug information could be found, otherwise an empty string, if the address is not valid. String Examples Selecting the first string from the trace_log system table
Query
Response
Getting the source code filename and the line number for a single address
Query
Response
Applying the function to the whole stack trace
Query
Response

addressToLineWithInlines

Introduced in: v22.2.0 Similar to addressToLine, but returns an Array with all inline functions. As a result of this, it is slower than addressToLine. To enable this introspection function: Syntax
Arguments
  • address_of_binary_instruction — The address of an instruction in a running process. UInt64
Returned value Returns an array whose first element is the source code filename and line number delimited by a colon. The second, third, etc. element list inline functions’ source code filenames, line numbers and function names. If no debug information could be found, then an array with a single element equal to the name of the binary is returned, otherwise an empty array is returned if the address is not valid. Array(String) Examples Applying the function to an address
Query
Response
Applying the function to the whole stack trace
Query
Response

addressToSymbol

Introduced in: v20.1.0 Converts virtual memory address inside the ClickHouse server process to a symbol from ClickHouse’s object files. Syntax
Arguments
  • address_of_binary_instruction — Address of instruction in a running process. UInt64
Returned value Returns the symbol from ClickHouse object files or an empty string, if the address is not valid. String Examples Selecting the first string from the trace_log system table
Query
Response
Getting a symbol for a single address
Query
Response
Applying the function to the whole stack trace
Query
Response

demangle

Introduced in: v20.1.0 Converts a symbol to a C++ function name. The symbol is usually returned by function addressToSymbol. Syntax
Arguments
  • symbol — Symbol from an object file. String
Returned value Returns the name of the C++ function, or an empty string if the symbol is not valid. String Examples Selecting the first string from the trace_log system table
Query
Response
Getting a function name for a single address
Query
Response
Applying the function to the whole stack trace
Query
Response

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
Arguments
  • nested_part — Name of expected nested part. String
  • covering_part — Name of expected covering part. String
Returned value Returns 1 if it covers, 0 otherwise. UInt8 Examples Basic example
Query
Response

logTrace

Introduced in: v20.12.0 Emits a trace log message to the server log for each Block. Syntax
Arguments
  • message — Message that is emitted to the server log. const String
Returned value Returns 0 always. UInt8 Examples Basic example
Query
Response

mergeTreePartInfo

Introduced in: v25.6.0 Function that helps to cut the useful values out of the MergeTree part name. Syntax
Arguments
  • part_name — Name of part to unpack. String
Returned value Returns a Tuple with subcolumns: partition_id, min_block, max_block, level, mutation. Tuple Examples Basic example
Query
Response

tid

Introduced in: v20.12.0 Returns id of the thread, in which the current Block is processed. Syntax
Arguments
  • None.
Returned value Returns the current thread id. UInt64 Examples Usage example
Query
Response
Last modified on June 19, 2026