Install any skill in seconds. Free to start, no credit card required.
Get Started Free →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.
.claude/skills/frankchen021-clickhouse-system-queries/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-04 | ✗→✓ | ▲ Improved | 81% | 0% |
| case-06 | ✗→✓ | ▲ Improved | -12% | 0% |
| case-13 | ✗→✓ | ▲ Improved | -11% | 0% |
| case-05 | ✓→✗ | ▼ Worse | -28% | 0% |
| case-07 | ✓→✗ | ▼ Worse | -35% | 0% |
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:
sql-- 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();
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.search_query_log for standard ranked searches and filtered lookupsexecute_sql for visualization, time-bucketed aggregation, trends, or histogramssql -- 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 bucket
Default to LIMIT 50 unless the user specifies otherwise.
system.query_log SQL until references/system-query-log.md is loaded in the current turnsearch_query_log for chart-oriented requestsLIMIT in exploratory queries| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 12,225 | 5,071 | -59% | 1 | 1 | 0% | 2,401 | 874 | -64% | 0 | 0 | — |
case-02 | fail→fail | 7,685 | 6,016 | -22% | 1 | 1 | 0% | 1,452 | 968 | -33% | 0 | 0 | — |
case-03 | fail→fail | 12,967 | 5,320 | -59% | 1 | 1 | 0% | 2,378 | 898 | -62% | 0 | 0 | — |
case-04 | fail→pass | 7,086 | 8,367 | +18% | 1 | 1 | 0% | 1,219 | 2,209 | +81% | 0 | 0 | — |
case-05 | pass→fail | 6,340 | 5,107 | -19% | 1 | 1 | 0% | 1,162 | 840 | -28% | 0 | 0 | — |
case-06 | fail→pass | 10,733 | 11,179 | +4% | 1 | 1 | 0% | 2,000 | 1,756 | -12% | 0 | 0 | — |
case-07 | pass→fail | 7,433 | 6,401 | -14% | 1 | 1 | 0% | 1,456 | 949 | -35% | 0 | 0 | — |
case-08 | fail→fail | 8,614 | 4,532 | -47% | 1 | 1 | 0% | 1,597 | 777 | -51% | 0 | 0 | — |
case-09 | fail→fail | 9,866 | 4,651 | -53% | 1 | 1 | 0% | 1,560 | 773 | -50% | 0 | 0 | — |
case-10 | fail→fail | 11,659 | 8,332 | -29% | 1 | 1 | 0% | 2,308 | 1,022 | -56% | 0 | 0 | — |
case-11 | fail→fail | 9,750 | 5,962 | -39% | 1 | 1 | 0% | 1,728 | 770 | -55% | 0 | 0 | — |
case-12 | fail→fail | 6,795 | 5,613 | -17% | 1 | 1 | 0% | 1,203 | 863 | -28% | 0 | 0 | — |
case-13 | fail→pass | 12,707 | 11,767 | -7% | 1 | 1 | 0% | 2,481 | 2,201 | -11% | 0 | 0 | — |
case-14 | fail→fail | 6,673 | 5,592 | -16% | 1 | 1 | 0% | 1,065 | 803 | -25% | 0 | 0 | — |
case-15 | pass→fail | 7,337 | 5,344 | -27% | 1 | 1 | 0% | 1,335 | 825 | -38% | 0 | 0 | — |
case-16 | fail→fail | 9,874 | 5,204 | -47% | 1 | 1 | 0% | 1,600 | 813 | -49% | 0 | 0 | — |
case-17 | pass→fail | 11,128 | 5,603 | -50% | 1 | 1 | 0% | 1,833 | 924 | -50% | 0 | 0 | — |
case-18 | fail→fail | 11,272 | 4,940 | -56% | 1 | 1 | 0% | 2,036 | 777 | -62% | 0 | 0 | — |
case-19 | fail→fail | 7,209 | 3,926 | -46% | 1 | 1 | 0% | 1,091 | 1,227 | +12% | 0 | 0 | — |
case-20 | pass→pass | 13,004 | 8,556 | -34% | 1 | 1 | 0% | 2,154 | 1,988 | -8% | 0 | 0 | — |
case-21 | pass→pass | 13,475 | 10,102 | -25% | 1 | 1 | 0% | 2,368 | 2,584 | +9% | 0 | 0 | — |
case-22 | pass→pass | 17,171 | 12,741 | -26% | 1 | 1 | 0% | 2,800 | 2,650 | -5% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted, and 7 counted toward the lift figure. The other 15 produced results that are not comparable between the two arms, so they are excluded from the headline rather than averaged into it. The headline lift of -5 percentage points is the difference between those two pass rates over the 7 comparable cases. 5 cases got worse with the skill loaded, and they are included in that figure.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.