Query ClickHouse system tables to inspect query logs, monitor cluster health, check replication status, and analyze slow queries. Use when the user mentions "system tables", "query_log", "ClickHouse monitoring", "cluster status", "slow queries", or asks to diagnose ClickHouse operational issues.
69
85%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Use this skill when the user asks for operational inspection on ClickHouse system.* tables.
Current table coverage:
system.query_log via references/system-query-log.mdRelationship to sql-expert:
sql-expert handles general SQL generation and user/business tables.columns list via explore_schema instead of loading the full table schema.ProfileEvents is a Map, access entries as ProfileEvents['Name']. If flattened, use ProfileEvent_Name.Example — map vs flattened access:
-- Map access
SELECT ProfileEvents['DistributedConnectionFailTry'] AS fails
FROM system.query_log WHERE event_date = today();
-- Flattened column access
SELECT ProfileEvent_DistributedConnectionFailTry AS fails
FROM system.query_log WHERE event_date = today();Resolve target — identify system table and intent. Inherit the most recent time window from conversation, or default to last 60 minutes.
Load reference — for system.query_log, call skill_resource to load references/system-query-log.md before writing any SQL. For unsupported tables, fall back to sql-expert.
Execute — choose the right tool:
search_query_log for standard ranked searches and filtered lookupsexecute_sql for visualization, time-bucketed aggregation, trends, or histograms-- search_query_log: standard lookup
-- finds top 10 slowest queries in the last hour
-- execute_sql: time-bucketed visualization
SELECT toStartOfFiveMinutes(event_time) AS bucket,
count() AS queries,
avg(query_duration_ms) AS avg_ms
FROM system.query_log
WHERE event_date = today() AND event_time > now() - INTERVAL 1 HOUR
GROUP BY bucket ORDER BY bucketDefault to LIMIT 50 unless the user specifies otherwise.
Summarize with concise findings and next actions.
system.query_log SQL until references/system-query-log.md is loaded in the current turnsearch_query_log for chart-oriented requestsLIMIT in exploratory queriesd0859a2
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.