mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-26 01:22:04 +00:00
Merge pull request #15679 from adevyatova/annadevyatova-DOCSUP-2861-codec
DOCSUP-2861: Add ability to specify Default codec
This commit is contained in:
commit
705abef402
@ -121,7 +121,9 @@ 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 `lz4` compression method. For `MergeTree`-engine family you can change the default compression method in the [compression](../../../operations/server-configuration-parameters/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.
|
By default, ClickHouse applies the `lz4` compression method. For `MergeTree`-engine family you can change the default compression method in the [compression](../../../operations/server-configuration-parameters/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
|
||||||
CREATE TABLE codec_example
|
CREATE TABLE codec_example
|
||||||
@ -136,7 +138,18 @@ ENGINE = <Engine>
|
|||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
If a codec is specified, the default codec doesn’t apply. Codecs can be combined in a pipeline, for example, `CODEC(Delta, ZSTD)`. To select the best codec combination for you project, pass benchmarks similar to described in the Altinity [New Encodings to Improve ClickHouse Efficiency](https://www.altinity.com/blog/2019/7/new-encodings-to-improve-clickhouse) article. One thing to note is that codec can't be applied for ALIAS column type.
|
The `Default` codec can be specified to reference default compression which may dependend on different settings (and properties of data) in runtime.
|
||||||
|
Example: `value UInt64 CODEC(Default)` - the same as lack of codec specification.
|
||||||
|
|
||||||
|
Also you can remove current CODEC from the column and use default compression from config.xml:
|
||||||
|
|
||||||
|
``` sql
|
||||||
|
ALTER TABLE codec_example MODIFY COLUMN float_value CODEC(Default);
|
||||||
|
```
|
||||||
|
|
||||||
|
Codecs can be combined in a pipeline, for example, `CODEC(Delta, Default)`.
|
||||||
|
|
||||||
|
To select the best codec combination for you project, pass benchmarks similar to described in the Altinity [New Encodings to Improve ClickHouse Efficiency](https://www.altinity.com/blog/2019/7/new-encodings-to-improve-clickhouse) article. One thing to note is that codec can't be applied for ALIAS column type.
|
||||||
|
|
||||||
!!! warning "Warning"
|
!!! warning "Warning"
|
||||||
You can’t decompress ClickHouse database files with external utilities like `lz4`. Instead, use the special [clickhouse-compressor](https://github.com/ClickHouse/ClickHouse/tree/master/programs/compressor) utility.
|
You can’t decompress ClickHouse database files with external utilities like `lz4`. Instead, use the special [clickhouse-compressor](https://github.com/ClickHouse/ClickHouse/tree/master/programs/compressor) utility.
|
||||||
|
Loading…
Reference in New Issue
Block a user