@@ -6,7 +6,7 @@ By going through this tutorial you'll learn how to set up basic ClickHouse clust
...
@@ -6,7 +6,7 @@ By going through this tutorial you'll learn how to set up basic ClickHouse clust
## Single Node Setup
## Single Node Setup
To postpone complexities of distributed environment, we'll start with deploying ClickHouse on a single server or virtual machine. ClickHouse is usually installed from [deb](index.md#from-deb-packages) or [rpm](index.md#from-rpm-packages) packages, but there are [alternatives](index.md#from-docker-image) for the operating systems that do no support them.
To postpone complexities of distributed environment, we'll start with deploying ClickHouse on a single server or virtual machine. ClickHouse is usually installed from [deb](index.md#install-from-deb-packages) or [rpm](index.md#from-rpm-packages) packages, but there are [alternatives](index.md#from-docker-image) for the operating systems that do no support them.
For example, you have chosen `deb` packages and executed:
For example, you have chosen `deb` packages and executed:
@@ -4,9 +4,9 @@ ClickHouse runs sampling profiler that allows to analyse query execution. Using
...
@@ -4,9 +4,9 @@ ClickHouse runs sampling profiler that allows to analyse query execution. Using
To use profiler:
To use profiler:
- Setup the [trace_log][../server_settings/settings.md#server_settings-trace_log] section of the server configuration.
- Setup the [trace_log](../server_settings/settings.md#server_settings-trace_log) section of the server configuration.
This section configures the [trace_log][../system_tables.md#system_tables-trace_log] system table containing the results of the profiler functioning. It is configured by default.
This section configures the [trace_log](../system_tables.md#system_tables-trace_log) system table containing the results of the profiler functioning. It is configured by default.
- Setup the [query_profiler_cpu_time_period_ns](../settings/settings.md#query_profiler_cpu_time_period_ns) and [query_profiler_real_time_period_ns](../settings/settings.md#query_profiler_real_time_period_ns) settings.
- Setup the [query_profiler_cpu_time_period_ns](../settings/settings.md#query_profiler_cpu_time_period_ns) and [query_profiler_real_time_period_ns](../settings/settings.md#query_profiler_real_time_period_ns) settings.
...
@@ -16,7 +16,7 @@ Default sampling frequency is one sample per second. This frequency allows to ca
...
@@ -16,7 +16,7 @@ Default sampling frequency is one sample per second. This frequency allows to ca
To analyze the `trace_log` system table:
To analyze the `trace_log` system table:
- Install the `clickhouse-common-static-dbg` package.
- Install the `clickhouse-common-static-dbg` package. See [Install from DEB Packages](../../getting_started/install.md#install-from-deb-packages).
- Allow introspection functions.
- Allow introspection functions.
For security reasons introspection functions are disabled by default.
For security reasons introspection functions are disabled by default.
Data compression settings for [MergeTree](../table_engines/mergetree.md)-engine tables.
!!! warning
!!! warning
Don't use it if you have just started using ClickHouse.
Don't use it if you have just started using ClickHouse.
The configuration looks like this:
Configuration template:
```xml
```xml
<compression>
<compression>
<case>
<case>
<parameters/>
<min_part_size>...</min_part_size>
<min_part_size_ratio>...</min_part_size_ratio>
<method>...</method>
</case>
</case>
...
...
</compression>
</compression>
```
```
You can configure multiple sections `<case>`.
`<case>` fields:
Block field `<case>`:
-`min_part_size` – The minimum size of a data part.
-`min_part_size_ratio` – The ratio of the data part size to the table size.
-`method` – Compression method. Acceptable values: `lz4` or `zstd`.
-``min_part_size`` – The minimum size of a table part.
You can configure multiple `<case>` sections.
-``min_part_size_ratio`` – The ratio of the minimum size of a table part to the full size of the table.
-``method`` – Compression method. Acceptable values : ``lz4`` or ``zstd``(experimental).
ClickHouse checks `min_part_size` and `min_part_size_ratio` and processes the `case` blocks that match these conditions. If none of the `<case>` matches, ClickHouse applies the `lz4` compression algorithm.
Actions when conditions are met:
- If a data part matches a condition set, ClickHouse uses the specified compression method.
- If a data part matches multiple condition sets, ClickHouse uses the first matched condition set.
If no conditions met for a data part, ClickHouse uses the `lz4` compression.
@@ -129,7 +129,7 @@ Defines storage time for values. Can be specified only for MergeTree-family tabl
...
@@ -129,7 +129,7 @@ Defines storage time for values. Can be specified only for MergeTree-family tabl
### Column Compression Codecs {#codecs}
### Column Compression Codecs {#codecs}
By default, ClickHouse applies the compression method, defined in [server settings](../operations/server_settings/settings.md#compression), to columns. You can also define the compression method for each individual column in the `CREATE TABLE` query.
By default, ClickHouse applies the `lz4` compression method. For `MergeTree`-engine family you can change the default compression method in the [compression](../operations/server_settings/settings.md#server-settings-compression) section of a server configuration. You can also define the compression method for each individual column in the `CREATE TABLE` query.
```sql
```sql
CREATETABLEcodec_example
CREATETABLEcodec_example
...
@@ -151,10 +151,10 @@ If a codec is specified, the default codec doesn't apply. Codecs can be combined
...
@@ -151,10 +151,10 @@ If a codec is specified, the default codec doesn't apply. Codecs can be combined
Compression is supported for the following table engines:
Compression is supported for the following table engines:
-[MergeTree](../operations/table_engines/mergetree.md) family
-[MergeTree](../operations/table_engines/mergetree.md) family. Supports column compression codecs and selecting the default compression method by [compression](../operations/server_settings/settings.md#server-settings-compression) settings.
-[Log](../operations/table_engines/log_family.md) family
-[Log](../operations/table_engines/log_family.md) family. Uses the `lz4` compression method by default and supports column compression codecs.
-[Set](../operations/table_engines/set.md)
-[Set](../operations/table_engines/set.md). Only supported the default compression.
-[Join](../operations/table_engines/join.md)
-[Join](../operations/table_engines/join.md). Only supported the default compression.
ClickHouse supports common purpose codecs and specialized codecs.
ClickHouse supports common purpose codecs and specialized codecs.