ClickHouse storage and maintenance

Use the Storage view of the ClickHouse tab to see how much space your tables take and to empty the platform's staging tables, and use the Merges view to merge fragmented parts that slow queries down. Some actions appear only if your role holds the matching permission.

Read how much space each table uses

  1. Open Observability > ClickHouse > Storage.
  2. Read the table list. It opens sorted by Active Parts, highest first. To find the largest tables, sort by Size On Disk.
  3. To narrow the list, type part of a database or table name in the search box, or turn on Hide system tables to leave out the database's own tables.

Each row shows Database, Table, Engine, Kind, Active Parts, Partitions, Rows, Size On Disk, Compressed, Uncompressed, PK In Memory, Index Granularity In Memory, Oldest Part and Newest Part. Kind shows System for the database's own tables; user tables leave that cell empty. You can filter Kind by System or User.

The table shows 50 rows at a time. You can switch to 100, 500 or 1000 rows. Changing the search or the Hide system tables switch returns the list to its first page. An empty list shows No tables with data parts.

SettingWhat it doesDefault
Hide system tablesHides the database's own tables from the list.Off

The Storage toolbar also holds the Excel export and the Empty staging tables action. The export downloads the current list as an Excel file named clickhouse-table-storage-YYYY-MM-DD.xlsx.

Merge parts into partitions

Many active parts in one partition can slow queries down. Merge parts into partitions runs OPTIMIZE on the tables whose partitions hold more than one active part. OPTIMIZE merges parts only within a partition, so every partition keeps at least one part. The action sits on the Merges toolbar; ClickHouse activity describes the view itself.

  1. Open Observability > ClickHouse > Merges.
  2. Click Merge parts into partitions.
  3. Read the preview. While it loads, it reads Checking which tables have parts to merge.... It then says either OPTIMIZE runs in the background on N tables and can reduce up to N parts across N partitions. or Every partition already holds a single active part.
  4. Click Start OPTIMIZE.

A Success toast then reads OPTIMIZE started on N tables.

Note

Start OPTIMIZE is disabled while the preview loads, and when every partition already holds a single active part. Only one OPTIMIZE run can be in progress at a time. If you start another, the Failed to start OPTIMIZE toast shows An OPTIMIZE run is still in progress. Wait for it to finish before starting another. If the preview cannot load, a Failed to load OPTIMIZE preview toast appears.

Empty staging tables

Staging tables hold intermediate data while the platform loads or transforms data. Use Empty staging tables on the Storage toolbar to clear that leftover data; the button's tooltip reads Remove every row from the ClickHouse staging tables, keeping the tables.

The dialog lists three kinds:

  1. Open Observability > ClickHouse > Storage.
  2. Click Empty staging tables.
  3. Check the kinds you want to empty. All three are selected by default, and all three are selected again when you reopen the dialog. Each one shows its number of tables, parts, rows and size.
  4. Click Empty tables.
Important

The dialog says: "Removes every row from the selected ClickHouse staging tables. The tables themselves are kept." It lists only staging tables, so your own Lake and Warehouse tables are not emptied.

After the run, the Staging tables emptied toast reads Truncated N tables. If any table fails, the toast uses a warning style, names up to three failed tables with their errors, and says and N more for the rest. The other tables are still emptied.

If workflow jobs are running, the dialog shows Running workflows: <name> (#<id>) - try again when they finish. and Empty tables is disabled; it is also disabled while the counts load and when no kind is selected.

If a workflow starts after you open the dialog, the server refuses the run, and the Failed to empty staging tables toast shows Staging tables cannot be truncated while workflow jobs are running: <jobs>. Wait for them to finish or abort them, then try again. See Monitor and fix a run for how to stop a run.

If the dialog cannot load its counts, the toast reads Failed to load staging tables. The Observability troubleshooting page lists what to do for each message.

Find out what changed a table

The DDL log view has its own page: Table DDL logs. Open it to follow every table change the platform made, read a run's statements, schema changes and errors, and export the log.

Permissions

PermissionWhat it unlocks
View Active QueriesThe Storage and Merges views.
Manage ClickHouse MaintenanceMerge parts into partitions and Empty staging tables. Without it, both buttons are hidden.

The ClickHouse Maintenance Manager preset includes View Active Queries and Manage ClickHouse Maintenance. Set these in Roles and permissions. The full list is in the Permission reference.

Questions, answered

When should I merge parts?

When a table has many active parts in one partition and its queries feel slow. Open Merges and read the preview. It shows how many parts can be reduced before you start.

Why is Start OPTIMIZE disabled?

Either the preview is still loading, or every partition already holds a single active part, so there is nothing to merge.

Can I start a second OPTIMIZE while one is running?

No. The platform refuses a second run and shows the message in the Failed to start OPTIMIZE toast. Wait for the current run to finish, then start again.

Does emptying staging tables delete my data?

No. It removes rows from the platform's staging tables only, and keeps the tables. Your own Lake and Warehouse tables are not in the list, so they are not emptied.

Why can't I empty staging tables?

Workflow jobs are running. Wait for them to finish or abort them, then try again. The dialog names the running workflows and keeps Empty tables disabled.

How do I find the biggest tables?

Open Storage and sort by Size On Disk. Turn on Hide system tables to leave out the database's own tables.

What can I export from Storage?

Excel only. The download is named clickhouse-table-storage-YYYY-MM-DD.xlsx and reflects the current search and Hide system tables setting.

Why does the Storage list jump back to the first page?

The list returns to its first page when you change the search or turn Hide system tables on or off.

Where can I find the DDL log?

It has its own page: Table DDL logs. It lists the changes the platform made to your tables, with each run's statements, schema changes and errors.

Why don't I see the maintenance buttons?

The buttons need Manage ClickHouse Maintenance. Ask an administrator to add it to one of your roles. See Roles and permissions.