---
metadata:
  - name: generator
    content: Diplodoc Platform v5.50.4
alternate:
  - https://ydb.tech/docs/en/yql/reference/syntax/create_table/family.md
  - https://ydb.tech/docs/ru/yql/reference/syntax/create_table/family.md
sourcePath: en/core/yql/reference/syntax/create_table/family.md
---
> **Documentation Index:** Fetch the complete configuration index at https://ydb.tech/docs/en/llms.txt

# Column groups

Columns of the same table can be grouped to set the following parameters:

* `DATA`: A storage device type for the data in this column group. Acceptable values: `ssd`, `rot`.


<!-- source: en/_includes/only_allow_for_oltp_note.md -->
{% note warning %}

<!-- source: en/_includes/only_allow_for_oltp_text.md -->
Supported only for [row-oriented](https://ydb.tech/docs/en/concepts/datamodel/table.md#row-oriented-tables) tables.
<!-- endsource: en/_includes/only_allow_for_oltp_text.md -->

{% endnote %}
<!-- endsource: en/_includes/only_allow_for_oltp_note.md -->


* `COMPRESSION`: A data compression codec. Acceptable values: `off`, `lz4`, `zstd`.


<!-- source: en/_includes/codec_zstd_allow_for_olap_note.md -->
{% note warning %}

<!-- source: en/_includes/codec_zstd_allow_for_olap_text.md -->
Codec `"zstd"` is supported only for [column-oriented](https://ydb.tech/docs/en/concepts/datamodel/table.md#column-oriented-tables) tables.
<!-- endsource: en/_includes/codec_zstd_allow_for_olap_text.md -->

{% endnote %}
<!-- endsource: en/_includes/codec_zstd_allow_for_olap_note.md -->


* `COMPRESSION_LEVEL` — compression level of codec if it supports different compression levels.


<!-- source: en/_includes/only_allow_for_olap_note.md -->
{% note warning %}

<!-- source: en/_includes/only_allow_for_olap_text.md -->
Supported only for [column-oriented](https://ydb.tech/docs/en/concepts/datamodel/table.md#column-oriented-tables) tables.
<!-- endsource: en/_includes/only_allow_for_olap_text.md -->

{% endnote %}
<!-- endsource: en/_includes/only_allow_for_olap_note.md -->


By default, all columns are in the same group named `default`.  If necessary, the parameters of this group can also be redefined, if they are not redefined, then predefined values are applied.

## Example

In the example below, for the created table, the `family_large` group of columns is added and set for the `series_info` column, and the parameters for the default group, which is set by `default` for all other columns, are also redefined.

{% list tabs %}

- Creating a row-oriented table

    ```sql
    CREATE TABLE series_with_families (
        series_id Uint64,
        title Utf8,
        series_info Utf8 FAMILY family_large,
        release_date Uint64,
        PRIMARY KEY (series_id),
        FAMILY default (
            DATA = "ssd",
            COMPRESSION = "off"
        ),
        FAMILY family_large (
            DATA = "rot",
            COMPRESSION = "lz4"
        )
    );
    ```

- Creating a column-oriented table

    ```sql
    CREATE TABLE series_with_families (
        series_id Uint64 NOT NULL,
        title Utf8,
        series_info Utf8 FAMILY family_large,
        release_date Uint64,
        PRIMARY KEY (series_id),
        FAMILY default (
            COMPRESSION = "lz4"
        ),
        FAMILY family_large (
            COMPRESSION = "zstd",
            COMPRESSION_LEVEL = 5
        )
    ) 
    WITH (STORE = COLUMN);
    ```

{% endlist %}

{% note info %}

Available types of storage devices depend on the YDB cluster configuration.

{% endnote %}
