描述
包含服务器所知晓的每个表的元数据。
Detached 表不会显示在 system.tables 中。
临时表 仅在创建它们的那些会话的 system.tables 中可见。它们的 database field 为空,且 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))) — parameterized view 的参数。partition_key(String) — 表中指定的分区键表达式。sorting_key(String) — 表中指定的排序键表达式。primary_key(String) — 表中指定的主键表达式。sampling_key(String) — 表中指定的采样键表达式。unique_key(String) — 表中指定的唯一键表达式 (UNIQUE KEY 子句) 。skipping_indices_types(Array(String)) — 表上定义的数据跳过索引的不同类型数组 (例如 minmax、set、bloom_filter、ngrambf_v1、tokenbf_v1、text、vector_similarity) 。没有跳过索引的表为空。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)) — 此表中 parts 的总数。active_parts(Nullable(UInt64)) — 此表中活跃 parts 的数量。total_marks(Nullable(UInt64)) — 此表中所有 parts 的标记总数。active_on_fly_data_mutations(UInt64) — 可即时应用的活跃数据变更 (UPDATE 和 DELETE) 总数。active_on_fly_alter_mutations(UInt64) — 可即时应用的活跃 ALTER 变更 (MODIFY COLUMN) 总数。active_on_fly_metadata_mutations(UInt64) — 可即时应用的活跃元数据变更 (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)) — 依赖于加载当前对象的表。target_database(String) — 对于 materialized view,视图写入的目标端表所在的数据库 (TO目标,或隐式.inner.*表) 。其他引擎为空。target_table(String) — 对于 materialized view,视图写入的目标端表名称 (TO目标,或隐式.inner.*表) 。其他引擎为空。definer(String) — 该表使用的 SQL security definer 名称。
别名:
table是name的别名。
示例
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:
skipping_indices_types: []
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:
skipping_indices_types: []
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: []