首页 > 解决方案 > 如何显示 ClickHouse 数据库中的表正在使用什么引擎?

问题描述

是否有任何命令/SQL 可以显示 ClickHouse 数据库中的表正在使用什么引擎?

create table t (id UInt16, name String) ENGINE = Memory;
insert into t(id, name) values (1, 'abc'), (2, 'xyz');

create table t2 as t ENGINE = TinyLog;
insert into t2(id, name) values (3, 'efg'), (4, 'hij');

create table t3 ENGINE = Log as select * from t;

describe 命令不显示引擎信息

describe t

我如何知道正在使用哪个引擎?

标签: clickhouse

解决方案


如果你跑

SHOW CREATE TABLE t

它将为您提供查询以重新创建t包含 ENGINE 信息的表。

或运行

SELECT database, name, engine, engine_full
FROM system.tables

推荐阅读