ClickHouse activity

The ClickHouse tab shows what the database is doing right now: the queries running, background merges, mutations and materialized view refreshes, and the database's own memory. History charts how much storage each database and table uses over time. Use it when a report is slow, a change seems stuck, or you want to see where the space goes.

Open a ClickHouse view

  1. Open Observability from the sidebar.
  2. Click ClickHouse in the row of tabs at the top.
  3. Click a view in the toggle.

The toggle shows only the views you can open. The ClickHouse tab itself appears when you can open at least one of them. It opens on Queries the first time; after that, it returns to the view you used last in this browser. Each view has its own address, so you can bookmark one or share it. Older addresses still open the right view: running-queries opens Queries, database-overview opens History and table-ddl-logs opens the DDL log. The History view takes the full width of the page.

ViewWhat it showsPermission
QueriesThe queries running now, with their progress and memory. You can stop them, and once unlocked a PostgreSQL table appears as well. Read Running queries.View Active Queries
MergesBackground merges, with their progress, memory and parts.View Active Queries
MutationsUnfinished changes to table rows, with their latest failure. You can kill them.View Active Queries
MV refreshesRefreshes of refreshable materialized views, with their last and next refresh.View Active Queries
MemoryThe database's memory right now, in four groups.View Active Queries
StorageTable storage, with parts, rows and sizes per table. Read ClickHouse storage and maintenance.View Active Queries
HistoryStorage on disk over time, per database or per table.View Database Overview
DDL logTable changes the platform made. Read Table DDL logs.View Table DDLs

Sorting, columns and exports

Follow background merges

Merges lists the merges ClickHouse runs in the background, sorted by Memory, highest first. It is empty when nothing is merging: No merges running.

Each row shows Database, Table, Progress, Elapsed, Memory, Parts, Compressed Size, Uncompressed Size, Rows Read, Rows Written, Merge Type, Algorithm, Kind, Result Part and Partition.

Too many active parts in one partition can slow queries down. From Merges, Merge parts into partitions runs OPTIMIZE on the tables whose partitions hold more than one active part. It needs Manage ClickHouse Maintenance; without it, the button is hidden. The flow and its guard messages are on ClickHouse storage and maintenance.

Stop a stuck mutation

Mutations lists unfinished changes to table rows. Each row shows Database, Table, Mutation ID, Command, Created, Parts To Do, Parts In Progress, Latest Failure, Failed At and Failed Part. Command opens the mutation's SQL, and Latest Failure opens the full failure text. When none are running, the list reads No mutations running.

Killing a mutation needs Stop Active Queries. Without it, the red icon does not appear at the end of the row.

  1. Open Observability > ClickHouse > Mutations.
  2. Click the red icon at the end of the mutation's row.
  3. In Kill Mutation, read Kill mutation <id> on <database>.<table>? and click Confirm.

If cancellation starts, you see Cancellation requested for mutation <id> on <database>.<table>. If the mutation had already finished, you see No mutation <id> found on <database>.<table>. It may have already finished. If ClickHouse cannot cancel it, you see ClickHouse could not cancel mutation <id> on <database>.<table>.

Follow view refreshes

MV refreshes lists refreshable materialized views: their Status, Progress, Read Rows, Total Rows and Written Rows, when they last succeeded (Last Success and Last Success Duration), and their Last Refresh and Next Refresh times. Retry shows how often the refresh has been retried, and Exception opens the full error text.

Refreshes that are running appear first; the rest follow by their next refresh time. When nothing is refreshing, the list reads No refreshable materialized views.

Read the database's memory

  1. Open Observability > ClickHouse > Memory.
  2. Read the four groups: Server, Caches, Background & queries and Data structures.
  3. Click Refresh to update the figures.

The Server group shows Tracked by ClickHouse, Resident (RSS), Server memory limit and Container usage incl. page cache. Compare the first two with Server memory limit to see how much of the limit is in use. The other groups hold, for example, Mark cache under Caches; Running queries, Merges, Pending mutations and Running MV refreshes under Background & queries; and Primary keys in memory and Active parts under Data structures. Groups with no items are hidden, and an empty view reads No memory metrics available.

See storage over time

History charts how much space your databases and tables use on disk over the chosen period.

  1. Open Observability > ClickHouse > History.
  2. Set Period · to Last 1h, Last 24h, Last 7d, Last 30d or Custom, and set Interval · to choose how the chart groups points.
  3. Choose Databases or Tables.

In Databases:

In Tables:

The refresh button in the toolbar resets the view: Period · returns to Last 7d and the interval returns to its default. It is available only when something differs from the defaults. An empty database list reads No databases in this range. An empty chart reads No data, with "No memory samples for this range."

Settings and defaults

SettingWhat it doesDefault
View toggleChooses the ClickHouse view.The view you used last in this browser; Queries the first time
Period · (History)Sets the time range of the chart and the cards.Last 7d
Interval · (History)Sets how the chart groups points.An interval suited to the range
Databases / Tables (History)One card per database, or one per table.Databases

These choices are kept in your browser, not on your account.

Permissions

PermissionWhat it lets you do
View Active QueriesSee Queries, Merges, Mutations, MV refreshes, Memory and Storage.
Stop Active QueriesStop running queries and kill mutations.
Manage ClickHouse MaintenanceRun Merge parts into partitions on Merges, and empty staging tables on Storage.
View Database OverviewSee History.
View Table DDLsSee the DDL log.

The Active Queries Viewer and Database Overview Viewer presets each bundle one of these permissions. Active Queries Manager adds Stop Active Queries, and ClickHouse Maintenance Manager adds Manage ClickHouse Maintenance. The Observability Administrator preset includes all of them; the Observability Viewer preset cannot stop queries or kill mutations. See the permission reference and roles and permissions.

Limits and edge cases

Questions, answered

A report is slow. Where should I look first?

Open Queries and sort by Elapsed Time or Memory Usage to find the query that is running long. Also open Merges to check for heavy background merges. To stop a query, see Running queries.

What is a mutation, and when should I kill one?

A mutation is a background change to existing rows of a table, such as an update or a delete. Kill one that keeps failing, as shown in Latest Failure, or one that blocks other work. Killing a mutation needs Stop Active Queries.

Why does the Mutations list say "It may have already finished"?

The mutation was no longer running when you clicked kill, so there was nothing to cancel. No action is needed.

The Merges list is empty. Is something wrong?

No. Merges lists only the merges running at that moment. No merges running means nothing is merging right now.

How much memory is the database using?

Open Memory. Tracked by ClickHouse and Resident (RSS) show the current use. Compare them with Server memory limit.

How do I see which table grew the most?

Open History, choose Tables, set Period · to Last 30d and compare the trend on each card. Last 30d is the closest preset to a month.

What does the percentage next to a database mean?

It is the share of space saved by compression for that database's tables. Hover the badge to see the calculation.

What does the refresh button on History do?

It resets the view: Period · returns to Last 7d and the interval returns to its default. It is available only when something differs from the defaults.

Why can't I see the History view?

History needs View Database Overview. Ask an administrator to give your role that permission.

How do I come back to a view, or share it?

Each view has its own address in the browser, so you can copy the address to share it. When you come back, the tab opens the view you used last in this browser.