Project: ClickHouse (App Definition and Development / Database)
File: tables.md

slug: /en/operations/system-tables/tables Contains metadata of each table that the server knows about. tables are not shown in `system.tables`. are visible in the `system.tables` only in those session where they have been created. They are shown with the empty `database` field and with the `is_temporary` flag switched on. Columns: `database` () The name of the database the table is in. `name` () Table name. `uuid` () Table uuid (Atomic database). `engine` () Table engine name (without parameters). `is_temporary` () - Flag that indicates whether the table is temporary. `data_paths` (()) - Paths to the table data in the file systems. `metadata_path` () - Path to the table metadata in the file system. `metadatamodificationtime` () - Time of latest modification of the table metadata. `metadata_version` () - Metadata version for ReplicatedMergeTree table, 0 for non ReplicatedMergeTree table. `dependencies_database` (()) - Database dependencies. `dependencies_table` (()) - Table dependencies ( the current table). `createtablequery` () - The query that was used to create the table. `engine_full` () - Parameters of the table engine. `as_select` () - `SELECT` query for view. `partition_key` () - The partition key expression specified in the table. `sorting_key` () - The sorting key expression specified in the table. `primary_key` () - The primary key expression specified in the table. `sampling_key` () - The sampling key expression specified in the table. `storage_policy` () - The storage policy: - `total_rows` (()) - Total number of rows, if it is possible to quickly determine exact number of rows in the table, otherwise `NULL` (including underlying `Buffer` table). `total_bytes` (()) - Total number of bytes, if it is possible to quickly determine exact number of bytes for the table on storage, otherwise `NULL` (does not includes any underlying storage). If the table stores data on disk, returns used space on disk (i.e.compressed). If the table stores data in memory, returns approximated number of used bytes in

`totalbytesuncompressed` (()) - Total number of uncompressed bytes, if it's possible to quickly determine the exact number of bytes from the part checksums for the table on storage, otherwise `NULL` (does not take underlying storage (if any) into account). `lifetime_rows` (()) - Total number of rows INSERTed since server start (only for `Buffer` tables). `lifetime_bytes` (()) - Total number of bytes INSERTed since server start (only for `Buffer` tables). `comment` () - The comment for the table. `hasowndata` () Flag that indicates whether the table itself stores some data on disk or only accesses some other source. `loadingdependenciesdatabase` (()) - Database loading dependencies (list of objects which should be loaded before the current object). `loadingdependenciestable` (()) - Table loading dependencies (list of objects which should be loaded before the current object). `loadingdependentdatabase` (()) - Dependent loading database. `loadingdependenttable` (()) - Dependent loading table. The `system.tables` table is used in `SHOW TABLES` query implementation. Example ```sql SELECT * FROM system.tables LIMIT 2 FORMAT Vertical; ``` ```text 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 metadatamodificationtime: 2021-01-25 19:14:32 dependencies_database: [] dependencies_table: [] createtablequery: CREATE TABLE base.t1 (`n` UInt64) ENGINE = MergeTree ORDER BY n SETTINGS index_granularity = 8192 enginefull: MergeTree ORDER BY n SETTINGS indexgranularity = 8192 asselect: SELECT database AS tablecatalog partition_key: sorting_key: n primary_key: n sampling_key: storage_policy: default total_rows: 1 total_bytes: 99 lifetime_rows: lifetime_bytes: comment: hasowndata: 0 loadingdependenciesdatabase: [] loadingdependenciestable: [] loadingdependentdatabase: [] loadingdependenttable: [] 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 metadatamodificationtime: 2020-09-23 09:05:36 dependencies_database: [] dependencies_table: [] createtablequery: CREATE TABLE default.`53r93yleapyears` (`id` Int8, `febdays` Int8) ENGINE = MergeTree ORDER BY id SETTINGS index_granularity = 8192 enginefull: MergeTree ORDER BY id SETTINGS indexgranularity = 8192 asselect: SELECT name AS catalogname partition_key: sorting_key: id primary_key: id sampling_key: storage_policy: default total_rows: 2 total_bytes: 155 lifetime_rows: lifetime_bytes: comment: hasowndata: 0 loadingdependenciesdatabase: [] loadingdependenciestable: [] loadingdependentdatabase: [] loadingdependenttable: [] ```