提交 6007dc3e 编写于 作者: A Andrey Dudin 提交者: alexey-milovidov

Settings

上级 035c256e
Настройки
Settings
==========
Здесь будут рассмотрены настройки, которые можно задать с помощью запроса SET или в конфигурационном файле. Напомню, что эти настройки могут быть выставлены в пределах сессии или глобально. Настройки, которые можно задать только в конфигурационном файле сервера, здесь рассмотрены не будут.
In this section, we review settings that you can make using a SET query or in a config file. Remember that these settings can be set for a session or globally. Settings that can only be made in the server config file are not covered here.
.. toctree::
:glob:
......
此差异已折叠。
Профили настроек
Settings profiles
================
Профили настроек - это множество настроек, сгруппированных под одним именем. Для каждого пользователя ClickHouse указывается некоторый профиль.
Все настройки профиля можно применить, установив настройку с именем profile. Пример:
A settings profile is a collection of settings grouped under the same name. Each ClickHouse user has a profile.
To apply all the settings in a profile, set 'profile'. Example:
::
SET profile = 'web'
- установить профиль web - то есть, установить все настройки, относящиеся к профилю web.
- Load the 'web' profile. That is, set all the options belonging to the 'web' profile.
Профили настроек объявляются в конфигурационном файле пользователей. Обычно это - ``users.xml``.
Пример:
Settings profiles are declared in the user config file. This is normally 'users.xml'.
Example:
.. code-block:: xml
<!-- Профили настроек. -->
<!-- Settings profiles. -->
<profiles>
<!-- Настройки по умолчанию -->
<!-- Default settings -->
<default>
<!-- Максимальное количество потоков при выполнении одного запроса. -->
<!-- Maximum number of threads for executing a single query. -->
<max_threads>8</max_threads>
</default>
<!-- Настройки для запросов из пользовательского интерфейса -->
<!-- Settings for queries from the user interface -->
<web>
<max_rows_to_read>1000000000</max_rows_to_read>
<max_bytes_to_read>100000000000</max_bytes_to_read>
<max_rows_to_group_by>1000000</max_rows_to_group_by>
<group_by_overflow_mode>any</group_by_overflow_mode>
<max_rows_to_sort>1000000</max_rows_to_sort>
<max_bytes_to_sort>1000000000</max_bytes_to_sort>
<max_result_rows>100000</max_result_rows>
<max_result_bytes>100000000</max_result_bytes>
<result_overflow_mode>break</result_overflow_mode>
<max_execution_time>600</max_execution_time>
<min_execution_speed>1000000</min_execution_speed>
<timeout_before_checking_execution_speed>15</timeout_before_checking_execution_speed>
<max_columns_to_read>25</max_columns_to_read>
<max_temporary_columns>100</max_temporary_columns>
<max_temporary_non_const_columns>50</max_temporary_non_const_columns>
<max_subquery_depth>2</max_subquery_depth>
<max_pipeline_depth>25</max_pipeline_depth>
<max_ast_depth>50</max_ast_depth>
<max_ast_elements>100</max_ast_elements>
<readonly>1</readonly>
</web>
</profiles>
В примере задано два профиля: ``default`` и ``web``. Профиль ``default`` имеет специальное значение - он всегда обязан присутствовать и применяется при запуске сервера. То есть, профиль default содержит настройки по умолчанию. Профиль web - обычный профиль, который может быть установлен с помощью запроса SET или с помощью параметра URL при запросе по HTTP.
In the example, two profiles are set: ``default`` and ``web``. The ``default`` profile has a special purpose - it must always be present and is applied when starting the server. In other words, the ``default`` profile contains default settings. The ``web`` profile is a regular profile that can be set using the SET query or using a URL parameter in an HTTP query.
Профили настроек могут наследоваться от друг-друга - это реализуется указанием настройки profile перед остальными настройками, перечисленными в профиле.
Settings profiles can inherit from each other. To use inheritance, indicate the 'profile' setting before the other settings that are listed in the profile.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册