2020-04-03 13:23:32 +00:00
---
toc_priority: 61
toc_title: Settings Profiles
---
2020-03-20 10:10:48 +00:00
# Settings Profiles {#settings-profiles}
2017-12-28 15:13:23 +00:00
2020-04-15 14:57:49 +00:00
A settings profile is a collection of settings grouped under the same name.
!!! note "Information"
2020-06-18 08:24:31 +00:00
ClickHouse also supports [SQL-driven workflow ](../../operations/access-rights.md#access-control ) for managing settings profiles. We recommend using it.
2020-04-15 14:57:49 +00:00
2020-05-15 20:30:51 +00:00
The profile can have any name. You can specify the same profile for different users. The most important thing you can write in the settings profile is `readonly=1` , which ensures read-only access.
2020-04-14 10:14:19 +00:00
Settings profiles can inherit from each other. To use inheritance, indicate one or multiple `profile` settings before the other settings that are listed in the profile. In case when one setting is defined in different profiles, the latest defined is used.
2018-12-25 15:25:43 +00:00
To apply all the settings in a profile, set the `profile` setting.
2018-04-28 11:45:37 +00:00
Example:
2018-09-04 11:18:59 +00:00
Install the `web` profile.
2017-12-28 15:13:23 +00:00
2018-10-16 10:47:17 +00:00
``` sql
2017-12-28 15:13:23 +00:00
SET profile = 'web'
```
Settings profiles are declared in the user config file. This is usually `users.xml` .
2018-04-28 11:45:37 +00:00
2017-12-28 15:13:23 +00:00
Example:
2020-03-20 10:10:48 +00:00
``` xml
2018-01-19 14:36:40 +00:00
<!-- Settings profiles -->
2017-12-28 15:13:23 +00:00
< profiles >
2018-04-28 11:45:37 +00:00
<!-- Default settings -->
2017-12-28 15:13:23 +00:00
< default >
2018-04-28 11:53:59 +00:00
<!-- The maximum number of threads when running a single query. -->
< max_threads > 8< / max_threads >
< / default >
<!-- Settings for quries from the user interface -->
2017-12-28 15:13:23 +00:00
< 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 >
```
2020-06-18 08:24:31 +00:00
The example specifies two profiles: `default` and `web` .
2018-09-04 11:18:59 +00:00
2020-06-18 08:24:31 +00:00
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.
2020-04-14 10:14:19 +00:00
The `web` profile is a regular profile that can be set using the `SET` query or using a URL parameter in an HTTP query.
2017-12-28 15:13:23 +00:00
2021-09-19 20:05:54 +00:00
[Original article ](https://clickhouse.com/docs/en/operations/settings/settings_profiles/ ) <!--hide-->