> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-fbfa8bee.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> すべてのテーブルにあるカラムの情報を含むシステムテーブル

# system.columns

<div id="description">
  ## 説明
</div>

すべてのテーブルのカラムに関する情報が含まれています。

このテーブルを使うと、[DESCRIBE TABLE](/ja/reference/statements/describe-table) クエリと同様の情報を、複数のテーブルについて一度に取得できます。

[一時テーブル](/ja/reference/statements/create/table#temporary-tables) のカラムは、作成されたセッションでのみ `system.columns` に表示されます。これらは `database` フィールドが空の状態で表示されます。

<div id="columns">
  ## カラム
</div>

* `database` ([String](/ja/reference/data-types/index)) — データベース名。
* `table` ([String](/ja/reference/data-types/index)) — テーブル名。
* `name` ([String](/ja/reference/data-types/index)) — カラム名。
* `type` ([String](/ja/reference/data-types/index)) — カラム型。
* `position` ([UInt64](/ja/reference/data-types/index)) — テーブル内でのカラムの序数位置。1 から始まります。
* `default_kind` ([String](/ja/reference/data-types/index)) — デフォルト値に対する式の種類 (DEFAULT、MATERIALIZED、ALIAS) 。定義されていない場合は空文字列です。
* `default_expression` ([String](/ja/reference/data-types/index)) — デフォルト値の式。定義されていない場合は空文字列です。
* `data_compressed_bytes` ([UInt64](/ja/reference/data-types/index)) — 圧縮データのサイズ (バイト単位) 。
* `data_uncompressed_bytes` ([UInt64](/ja/reference/data-types/index)) — 展開後のデータのサイズ (バイト単位) 。
* `marks_bytes` ([UInt64](/ja/reference/data-types/index)) — マークのサイズ (バイト単位) 。
* `comment` ([String](/ja/reference/data-types/index)) — カラムに対するコメント。定義されていない場合は空文字列です。
* `is_in_partition_key` ([UInt8](/ja/reference/data-types/index)) — そのカラムがパーティション式に含まれているかどうかを示すフラグ。
* `is_in_sorting_key` ([UInt8](/ja/reference/data-types/index)) — そのカラムがソートキー式に含まれているかどうかを示すフラグ。
* `is_in_primary_key` ([UInt8](/ja/reference/data-types/index)) — そのカラムが主キー式に含まれているかどうかを示すフラグ。
* `is_in_sampling_key` ([UInt8](/ja/reference/data-types/index)) — そのカラムがサンプリングキー式に含まれているかどうかを示すフラグ。
* `compression_codec` ([String](/ja/reference/data-types/index)) — 圧縮コーデック名。
* `character_octet_length` ([Nullable(UInt64)](/ja/reference/data-types/index)) — バイナリデータ、文字データ、テキストデータ、およびイメージの最大長 (バイト単位) 。ClickHouse では FixedString データ型でのみ意味があります。それ以外の場合は NULL 値が返されます。
* `numeric_precision` ([Nullable(UInt64)](/ja/reference/data-types/index)) — 近似数値データ、正確な数値データ、整数データ、または通貨データの精度。ClickHouse では、整数型ではビット幅、Decimal types では 10 進精度を表します。それ以外の場合は NULL 値が返されます。
* `numeric_precision_radix` ([Nullable(UInt64)](/ja/reference/data-types/index)) — 数値体系の基数。これは近似数値データ、正確な数値データ、整数データ、または通貨データの精度に対応します。ClickHouse では整数型で 2、Decimal types で 10 です。それ以外の場合は NULL 値が返されます。
* `numeric_scale` ([Nullable(UInt64)](/ja/reference/data-types/index)) — 近似数値データ、正確な数値データ、整数データ、または通貨データの scale。ClickHouse では Decimal types でのみ意味があります。それ以外の場合は NULL 値が返されます。
* `datetime_precision` ([Nullable(UInt64)](/ja/reference/data-types/index)) — DateTime64 データ型の 10 進精度。その他のデータ型では NULL 値が返されます。
* `serialization_hint` ([Nullable(String)](/ja/reference/data-types/index)) — 統計に基づいて INSERT 時のシリアライゼーションを選択するためのカラム向けヒント。
* `statistics` ([String](/ja/reference/data-types/index)) — このカラムに対して作成される統計の種類。

<div id="example">
  ## 例
</div>

```sql theme={null}
SELECT * FROM system.columns LIMIT 2 FORMAT Vertical;
```

```text theme={null}
Row 1:
──────
database:                INFORMATION_SCHEMA
table:                   COLUMNS
name:                    table_catalog
type:                    String
position:                1
default_kind:
default_expression:
data_compressed_bytes:   0
data_uncompressed_bytes: 0
marks_bytes:             0
comment:
is_in_partition_key:     0
is_in_sorting_key:       0
is_in_primary_key:       0
is_in_sampling_key:      0
compression_codec:
character_octet_length:  ᴺᵁᴸᴸ
numeric_precision:       ᴺᵁᴸᴸ
numeric_precision_radix: ᴺᵁᴸᴸ
numeric_scale:           ᴺᵁᴸᴸ
datetime_precision:      ᴺᵁᴸᴸ

Row 2:
──────
database:                INFORMATION_SCHEMA
table:                   COLUMNS
name:                    table_schema
type:                    String
position:                2
default_kind:
default_expression:
data_compressed_bytes:   0
data_uncompressed_bytes: 0
marks_bytes:             0
comment:
is_in_partition_key:     0
is_in_sorting_key:       0
is_in_primary_key:       0
is_in_sampling_key:      0
compression_codec:
character_octet_length:  ᴺᵁᴸᴸ
numeric_precision:       ᴺᵁᴸᴸ
numeric_precision_radix: ᴺᵁᴸᴸ
numeric_scale:           ᴺᵁᴸᴸ
datetime_precision:      ᴺᵁᴸᴸ
```
