Skip to main content

Query Monitor

Monitor running and historical queries with per-query resource attribution and analysis breakdowns.

Running Queries

Live view of all currently executing queries from system.processes:

  • Query text and query ID
  • Elapsed time and progress
  • Memory usage
  • CPU time (from ProfileEvents)
  • Read rows and bytes
  • User and client info

Query Analytics

Drill into any query to understand exactly where time and resources were spent. The analytics view decomposes a single query into its resource dimensions — helping you spot whether a query is I/O-bound, CPU-bound, or simply reading too much data.

  • Read profile — rows read, bytes read, marks read
  • Write profile — rows written, bytes written
  • CPU profile — user time, system time, wait time
  • I/O profile — disk reads, disk writes, network bytes
  • Cache hits — mark cache, uncompressed cache, compiled expression cache

Scan Efficiency

Visual breakdown of how ClickHouse pruned data before reading it. Shows the funnel from all columns/parts/marks down to what was actually read, with a combined Index Effectiveness verdict.

The pruning score combines both stages: 1 − (parts surviving partition pruning / total parts) × (marks surviving PK pruning / total marks). This avoids the pitfall of reporting "poor" when partition pruning already eliminated most data but the surviving part happens to have few marks.

Flamegraph

The query analytics includes a flamegraph view powered by Speedscope for visualizing query execution.

ClickHouse Cloud

On ClickHouse Cloud, introspection functions are disabled by default. You need to enable them before flamegraph data can be collected.

Per session:

SET allow_introspection_functions = 1;

To enable permanently, set it at the user or role level:

ALTER USER my_user SETTINGS allow_introspection_functions = 1;
-- or
ALTER ROLE my_role SETTINGS allow_introspection_functions = 1;

Health Map

Experimental

Requires the experimental features toggle in Settings. This is an early exploration — we are still figuring out which signals and hierarchy best surface actionable query health at a glance.

The Health Map tab shows an interactive sunburst that summarizes the overall health of query activity. The center ring shows a single green/yellow/red health state. Outer rings break this down by category — running query load, recent history patterns, concurrency slot usage — and then into individual queries at the leaf level.

Hover over any arc to expand its children and see a tooltip with the metric value. Click a leaf node to jump to that query: if it is still running, the Running tab opens with the query selected; if it has finished, the History tab opens instead.

Historical Analysis

Query history from system.query_log with:

  • Execution statistics and trends
  • Slow query identification
  • Resource consumption patterns over time
  • Query fingerprinting and grouping