Skip to main content
Card class: Non-HeroCategory: Performance

At a glance

Top 10 Slowest Queries ranks the ten longest-running queries seen over the last 24 hours, one query per row. It is the “where is the time going” view: instead of an aggregate latency number, it names the specific queries that are eating CPU, memory, and read bandwidth so a DBA can target the worst offenders directly. The table typically carries the query text (or its normalised hash), duration, rows read, and memory used.

What it tracks

The card reads from system.query_log, the table that records one row per completed query with its query_duration_ms, read_rows, read_bytes, memory_usage, and normalized_query_hash. Over a 24h window it orders by query_duration_ms descending and returns the top ten, broken down by row. These are the queries that dominate your instance: a single full-scan aggregation over a billion-row table, a missing PREWHERE filter, or a join that fans out far wider than expected. Grouping by normalized_query_hash shows when one query shape recurs and is collectively the heaviest, which matters more than a one-off heavy ad-hoc query. The card carries no alert threshold of its own; it is the diagnostic detail you open when Slow-Query Rate % or Query Latency p99 (ms) moves, to see exactly which statements are responsible.

Reconciling against the source

Confirm the ranking directly in clickhouse-client with SELECT query_duration_ms, read_rows, memory_usage, query FROM system.query_log WHERE type = 'QueryFinish' AND event_time > now() - INTERVAL 24 HOUR ORDER BY query_duration_ms DESC LIMIT 10. On ClickHouse Cloud the same query runs in the SQL console, and the managed service also exposes a query-insights view that ranks the heaviest query shapes over time.

Tracked live in Vortex IQ Nerve Centre

Top 10 Slowest Queries is one of hundreds of KPI pulses Vortex IQ tracks across ClickHouse and 70+ other ecommerce connectors. Nerve Centre runs the detection layer; Vortex Mind investigates the cause when something moves; Ask Viq lets you interrogate any number in plain English. Start for free or book a demo to see this metric running on your own data.