> ## Documentation Index
> Fetch the complete documentation index at: https://clickhouse.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# function_* session settings

> ClickHouse session settings in the function_* generated group.

These settings are available in [system.settings](https://clickhouse.com/docs/reference/system-tables/settings.md) and are autogenerated from [source](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp).

## function\_base58\_max\_input\_size

Type

UInt64

Default

10000

Maximum size, in bytes, of a single input value for the functions `base58Encode`, `base58Decode` and `tryBase58Decode`. The generic `base58` conversion is quadratic in the input length, so a single large value can run for a very long time. `base58` is meant for short data (keys, hashes, addresses), so the default of 10 KB is a generous safety threshold. `base58Encode` and `base58Decode` throw `TOO_LARGE_STRING_SIZE` for larger inputs, while `tryBase58Decode` returns an empty string. A value of `0` disables the limit (the behavior before this setting was introduced). The linear `base32` and `base64` functions are unaffected.

## function\_date\_trunc\_return\_type\_behavior

Type

UInt64

Default

0

Allows to change the behaviour of the result type of `dateTrunc` function.

Possible values:

* 0 - When the second argument is `DateTime64/Date32` the return type will be `DateTime64/Date32` regardless of the time unit in the first argument.
* 1 - For `Date32` the result is always `Date`. For `DateTime64` the result is `DateTime` for time units `second` and higher.

## function\_locate\_has\_mysql\_compatible\_argument\_order

Type

Bool

Default

1

Controls the order of arguments in function [locate](https://clickhouse.com/docs/reference/functions/regular-functions/string-search-functions.md#locate).

Possible values:

* 0 — Function `locate` accepts arguments `(haystack, needle[, start_pos])`.
* 1 — Function `locate` accepts arguments `(needle, haystack, [, start_pos])` (MySQL-compatible behavior)

## function\_range\_max\_elements\_in\_block

Type

UInt64

Default

500000000

Sets the safety threshold for data volume generated by functions [range](https://clickhouse.com/docs/reference/functions/regular-functions/array-functions.md#range),
[arrayPermutations](https://clickhouse.com/docs/reference/functions/regular-functions/array-functions.md#arrayPermutations),
[arrayPartialPermutations](https://clickhouse.com/docs/reference/functions/regular-functions/array-functions.md#arrayPartialPermutations),
[arrayCombinations](https://clickhouse.com/docs/reference/functions/regular-functions/array-functions.md#arrayCombinations),
[timeSeriesRange](https://clickhouse.com/docs/reference/functions/regular-functions/time-series-functions.md#timeSeriesRange),
and [timeSeriesFromGrid](https://clickhouse.com/docs/reference/functions/regular-functions/time-series-functions.md#timeSeriesFromGrid).
Defines the maximum number of values generated by functions per block of data (sum of array sizes for every row in a block).
For the combinatorics functions, which return `Array(Array(T))`, every generated inner array counts as its size plus one, so zero-length results still consume the limit.

Possible values:

* Positive integer.

**See Also**

* [`max_block_size`](https://clickhouse.com/docs/reference/settings/session-settings/max#max_block_size)
* [`min_insert_block_size_rows`](https://clickhouse.com/docs/reference/settings/session-settings/min-insert#min_insert_block_size_rows)

## function\_sleep\_max\_microseconds\_per\_block

Type

UInt64

Default

3000000

Maximum number of microseconds the function `sleep` is allowed to sleep for each block. If a user called it with a larger value, it throws an exception. It is a safety threshold.

## function\_visible\_width\_behavior

Type

UInt64

Default

1

The version of `visibleWidth` behavior. 0 - only count the number of code points; 1 - correctly count zero-width and combining characters, count full-width characters as two, estimate the tab width, count delete characters.
