メインコンテンツへスキップ
メインコンテンツへスキップ

system.tables

説明

サーバーが把握している各テーブルのメタデータを含みます。

Detached テーブルは system.tables には表示されません。

Temporary tables は、それらが作成されたセッション内でのみ system.tables に表示されます。これらは、database フィールドが空で、is_temporary フラグが有効になっている状態で表示されます。

カラム

  • database (String) — テーブルが含まれるデータベースの名前。
  • name (String) — テーブルの名前。
  • uuid (UUID) — テーブルの UUID (Atomic データベース) 。
  • engine (String) — テーブルエンジンの名前 (パラメータを含まない) 。
  • is_temporary (UInt8) — テーブルが一時的なものかどうかを示すフラグ。
  • data_paths (Array(String)) — ファイルシステム上のテーブルデータのパス。
  • metadata_path (String) — ファイルシステム上のテーブルメタデータのパス。
  • metadata_modification_time (DateTime) — テーブルのメタデータの最終変更時刻。
  • metadata_version (Int32) — ReplicatedMergeTree テーブルのメタデータのバージョン。ReplicatedMergeTree 以外のテーブルでは 0。
  • dependencies_database (Array(String)) — 依存先のデータベース。
  • dependencies_table (Array(String)) — テーブルの依存先 (現在のテーブルの materialized view) 。
  • create_table_query (String) — テーブルの作成に使用したクエリ。
  • engine_full (String) — テーブルエンジンのパラメータ。
  • as_select (String) — ビュー用のSELECTクエリ。
  • parameterized_view_parameters (Array(Tuple(name String, type String))) — パラメータ化ビューのパラメータ。
  • partition_key (String) — テーブルで指定されたパーティションキー式。
  • sorting_key (String) — テーブルに指定されたソートキーの式。
  • primary_key (String) — テーブルに指定された主キー式。
  • sampling_key (String) — テーブルで指定されたサンプリングキーの式。
  • storage_policy (String) — ストレージポリシー。MergeTree および Distributed エンジンを使用するテーブルに適用されます。
  • total_rows (Nullable(UInt64)) — 総行数。テーブルの正確な行数を迅速に判定できる場合はその値を返し、そうでない場合は NULL (基になる Buffer テーブルを含む) 。
  • total_bytes (Nullable(UInt64)) — ストレージ上のテーブルについて正確なバイト数を迅速に特定できる場合は総バイト数を返し、それ以外の場合は NULL を返します (基盤となるストレージは含みません) 。テーブルがデータをディスクに格納している場合は、ディスク上で使用されている容量 (つまり圧縮後のサイズ) を返します。テーブルがデータをメモリに格納している場合は、メモリ内で使用されているおおよそのバイト数を返します。
  • total_bytes_uncompressed (Nullable(UInt64)) — 非圧縮バイトの総数。ストレージ上のテーブルについて、часть のチェックサムから正確なバイト数を迅速に特定できる場合はその値、それ以外の場合は NULL (基盤となるストレージがある場合でも、それは考慮されません) 。
  • parts (Nullable(UInt64)) — このテーブル内のパーツの総数です。
  • active_parts (Nullable(UInt64)) — このテーブルのアクティブなパーツ数。
  • total_marks (Nullable(UInt64)) — このテーブル内のすべてのパーツに含まれるマークの総数。
  • active_on_fly_data_mutations (UInt64) — オンザフライで適用できる、アクティブなデータ mutation (UPDATE および DELETE) の総数。
  • active_on_fly_alter_mutations (UInt64) — 即時適用が可能な、アクティブなalter mutation (MODIFY COLUMN) の総数。
  • active_on_fly_metadata_mutations (UInt64) — その場で適用可能な、アクティブなメタデータ mutation (RENAME) の総数。
  • columns_descriptions_cache_size (UInt64) — *MergeTreeテーブルのカラムの説明キャッシュのサイズ
  • lifetime_rows (Nullable(UInt64)) — サーバー起動後にINSERTされた総行数 (Bufferテーブルのみ) 。
  • lifetime_bytes (Nullable(UInt64)) — サーバーの起動以降に INSERT されたバイトの総数 (Buffer テーブルでのみ有効) 。
  • comment (String) — テーブルに付けるコメント。
  • has_own_data (UInt8) — テーブル自体がディスク上にデータを保持しているか、それとも別のソースにのみアクセスしているかを示すフラグです。
  • loading_dependencies_database (Array(String)) — データベースの読み込み依存関係 (現在のオブジェクトより先に読み込む必要があるオブジェクトの一覧) 。
  • loading_dependencies_table (Array(String)) — テーブルの読み込み依存関係 (現在のオブジェクトより前に読み込む必要があるオブジェクトのリスト) 。
  • loading_dependent_database (Array(String)) — ロード中の依存先データベース。
  • loading_dependent_table (Array(String)) — 依存先の読み込みテーブル。
  • definer (String) — テーブルに使用されるSQL 보안のdefiner名。

SELECT * FROM system.tables LIMIT 2 FORMAT Vertical;
Row 1:
──────
database:                   base
name:                       t1
uuid:                       81b1c20a-b7c6-4116-a2ce-7583fb6b6736
engine:                     MergeTree
is_temporary:               0
data_paths:                 ['/var/lib/clickhouse/store/81b/81b1c20a-b7c6-4116-a2ce-7583fb6b6736/']
metadata_path:              /var/lib/clickhouse/store/461/461cf698-fd0b-406d-8c01-5d8fd5748a91/t1.sql
metadata_modification_time: 2021-01-25 19:14:32
dependencies_database:      []
dependencies_table:         []
create_table_query:         CREATE TABLE base.t1 (`n` UInt64) ENGINE = MergeTree ORDER BY n
engine_full:                MergeTree ORDER BY n
as_select:                  SELECT database AS table_catalog
partition_key:
sorting_key:                n
primary_key:                n
sampling_key:
storage_policy:             default
total_rows:                 1
total_bytes:                99
lifetime_rows:              ᴺᵁᴸᴸ
lifetime_bytes:             ᴺᵁᴸᴸ
comment:
has_own_data:               0
loading_dependencies_database: []
loading_dependencies_table:    []
loading_dependent_database:    []
loading_dependent_table:       []

Row 2:
──────
database:                   default
name:                       53r93yleapyears
uuid:                       00000000-0000-0000-0000-000000000000
engine:                     MergeTree
is_temporary:               0
data_paths:                 ['/var/lib/clickhouse/data/default/53r93yleapyears/']
metadata_path:              /var/lib/clickhouse/metadata/default/53r93yleapyears.sql
metadata_modification_time: 2020-09-23 09:05:36
dependencies_database:      []
dependencies_table:         []
create_table_query:         CREATE TABLE default.`53r93yleapyears` (`id` Int8, `febdays` Int8) ENGINE = MergeTree ORDER BY id
engine_full:                MergeTree ORDER BY id
as_select:                  SELECT name AS catalog_name
partition_key:
sorting_key:                id
primary_key:                id
sampling_key:
storage_policy:             default
total_rows:                 2
total_bytes:                155
lifetime_rows:              ᴺᵁᴸᴸ
lifetime_bytes:             ᴺᵁᴸᴸ
comment:
has_own_data:               0
loading_dependencies_database: []
loading_dependencies_table:    []
loading_dependent_database:    []
loading_dependent_table:       []