SHOW TABLES returns the names of all tables in the current or specified ClickHouse database.
Run SHOW TABLES
in your active database session. ClickHouse immediately returns every table name in that database.
Use SHOW TABLES FROM ecommerce
(or IN ecommerce
). This prevents accidental scans across the wrong schema when you work with multiple databases.
Append LIKE
or WHERE
. Example: SHOW TABLES FROM ecommerce LIKE 'ord%'
lists only tables whose names start with ord
.
WHERE
supports full expressions: SHOW TABLES FROM ecommerce WHERE name NOT LIKE '%tmp%'
skips temporary tables, improving readability.
Query system.tables
: SELECT name FROM system.tables WHERE database = 'ecommerce'
. This returns the same data and lets you join with other system views.
Prefix tables (e.g., customers_
, orders_
) so pattern filters remain reliable. Keep staging tables in separate databases to avoid noisy SHOW TABLES
outputs.
Listing tables before writing joins reduces typos and speeds up Galaxy’s AI autocompletion. Confirm table existence, naming, and case sensitivity up front.
Yes. ClickHouse treats views as tables in this listing, so plan naming conventions accordingly.
No. Metadata lives in system.tables
; ClickHouse returns results instantly even in large clusters.