Optimize slow queries, analyze SQL performance, and collect evidence for expensive workloads.
83
80%
Does it follow best practices?
Impact
Pending
No eval scenarios have been run
Passed
No known issues
Optimize this skill with Tessl
npx tessl skill review --optimize ./resources/skills/optimize-clickhouse-queries/SKILL.mdWorkflow is evidence-driven: collect evidence with tools, then recommend based on evidence only.
collect_sql_optimization_evidence immediately).{ "type": "optimization_skill_input" }search_query_log for discovery from system.query_log (slowest, most expensive, user-scoped, database-scoped, text-scoped, etc.).search_query_log cannot express the request, then load the clickhouse-system-queries skill, immediately call skill_resource for references/system-query-log.md, and follow that reference strictly.system.query_log from this skill when search_query_log can satisfy the request.query_id from the discovery results for the next step (evidence collection).time_window: Relative minutes from now (e.g., 60 = last hour).time_range: Absolute range { from: "ISO date", to: "ISO date" }.collect_sql_optimization_evidence after discovery, you MUST pass the same time_window or time_range used in discovery.collect_sql_optimization_evidence to light mode for the first pass.mode argument entirely unless full detail is required.mode: "full" only when the user explicitly asks for detailed/raw evidence or the light pass is insufficient.full just because the request says "optimize", "analyze", or "investigate".search_query_log to find candidates. If the request exceeds the tool's schema, then load clickhouse-system-queries, load references/system-query-log.md via skill_resource, and use that reference. Extract query_id from the results.collect_sql_optimization_evidence with query_id (preferred) or sql (and same time params if coming from discovery).validate_sql for any proposed SQL changes. Add inline comments (-- comment) to highlight key changes.optimization_target is present, treat it as the real local-table schema behind a Distributed table and base key/index recommendations on it.minmax for range predicates on sorted columns.set for low-cardinality equality filters.bloom_filter for high-cardinality equality filters (e.g., trace_id, user_id).tokenbf_v1 for frequent token-based text search.validate_sql before recommending.query_id instead of sql.query_id and SQL are available, prefer query_id to reduce tokens and avoid truncation issues.68a8440
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.