You need to enable JavaScript to run this app.
ByteHouse Cloud Data Warehouse Version

ByteHouse Cloud Data Warehouse Version

Copy page
Download PDF
System tables
system.tables
Copy page
Download PDF
system.tables

The system table system.tables contains information about all tables, including key attributes such as the table engine, structure (partition/sorting/primary key), storage path, data volume, and more. It is the core system table for viewing table structure and auditing table configuration.

Column names

| | | | \

Field nameData typeField description
\
databaseStringThe name of the database where the table resides.
\
nameStringThe name of the table.
\
engineStringThe table engine name (parameters not included), fixed as "CnchMergeTree".
\
is_temporaryUInt8Indicates whether the table is temporary:\
\
* 1 = Temporary table (automatically deleted after the session ends);\
* 0 = Permanent table (all examples are 0).
\
data_pathStringThe storage path of the table data in the file system.
\
metadata_pathStringThe storage path of the table metadata in the file system.
\
metadata_modification_timeDateTimeThe latest modification time of the table metadata.
\
dependencies_databaseArray(String)List of databases the table depends on.
\
dependencies_tableArray(String)List of other tables the table depends on, such as materialized views based on the current table, for example 'job_174990_kafka_mv'.
\
create_table_queryStringThe SQL statement used to create the table.
\
engine_fullStringParameters of the table engine.
\
as_selectStringAssociated information of the AS SELECT statement when creating the table.
\
partition_keyStringThe partition key expression specified in the table.
\
sorting_keyStringThe sorting key expression specified in the table.
\
primary_keyStringThe primary key expression specified in the table.
\
sampling_keyStringThe sampling key expression specified in the table.
\
storage_policyStringThe name of the storage policy used by the table.
\
total_rowsNullable(UInt64)Total number of rows in the table. If the exact number of rows in the table cannot be quickly determined, the row count returns as NULL, including underlying buffer tables.
\
total_bytesNullable(UInt64)Total number of bytes in the table. If the exact number of bytes stored in the table cannot be quickly determined, the byte count returns as NULL, excluding any underlying storage.
\
lifetime_rowsNullable(UInt64)NULL
\
lifetime_bytesNullable(UInt64)NULL
\
commentStringComment of the table.
\
has_own_dataUInt8Indicates whether the table has independent data storage:\
\
* 0 = No independent data;\
* 1 = Has independent data.

Example

Query tables in the database sales_db, returning only key fields:

SELECT 
  name AS table_name, 
  engine_full, 
  partition_key, 
  primary_key, 
  total_bytes 
FROM system.tables 
WHERE database = 'sales_db' 
LIMIT 10;

Example query results:
Image

Last updated: 2026.03.31 16:16:45