query

query is a skill for Claude Code, Codex from StarRocks/starrocks-debug-skills. It costs 73 tokens per session (7,172 once invoked), scanned A, original, Apache-2.0.

A query-troubleshooting skill for slow, stuck, or incorrect database queries. It follows the query from the front end to the back end and uses query profiles to locate bottlenecks.

In plain words
What is it for?
Use it to analyze query profiles, scan and join performance, predicate pushdown, runtime filters, memory failures, and wrong-result or executor-crash investigations.
Why use it?
It helps distinguish connection, locking, garbage-collection, scanning, data-skew, filtering, join, memory, and execution bugs.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: positional $N argument.

Good fit Use it to analyze query profiles, scan and join performance, predicate pushdown, runtime filters, memory failures, and wrong-result or executor-crash investigations.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/starrocks/starrocks-debug-skills/query
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add StarRocks/starrocks-debug-skills --skill query
Clone the repo
git clone --depth 1 https://github.com/StarRocks/starrocks-debug-skills

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for query

README.md
[![agentmods](https://agentmods.dev/badge/skills/starrocks/starrocks-debug-skills/query/github.svg)](https://agentmods.dev/skills/starrocks/starrocks-debug-skills/query)
Your own site
<a href="https://agentmods.dev/skills/starrocks/starrocks-debug-skills/query"><img src="https://agentmods.dev/badge/skills/starrocks/starrocks-debug-skills/query/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for query

Your own site · 80×15
<a href="https://agentmods.dev/skills/starrocks/starrocks-debug-skills/query"><img src="https://agentmods.dev/badge/skills/starrocks/starrocks-debug-skills/query.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 73 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 7,172 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00073 $0.07172
Opus 5.5 $0.00029 $0.02869
Sonnet 5.5 $0.00015 $0.01434
Haiku 4.5 $0.00007 $0.00717

Measured 1mo ago against content hash 4a1c007ad1ba, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

query scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

The scan reads SKILL.md. This mod also ships 1 executable file (scripts/analyze_logs.py), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s "http://<be_ip>:8040/metrics" | grep "tablet_cumulative_max_compaction_score"
query/SKILL.md · 715 lines

How it starts

The opening of the file, as written. The whole thing — 715 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Query Troubleshooting

Investigation guide for query hangs, slow queries, profile analysis, scan performance, join performance, and bug localization.

Three root causes account for the vast majority of cases:

  • Cause A — Network/connection issue (TCP backlog, accept queue saturation)
  • Cause B — FE lock / GC blocking (deadlock, full GC pause)
  • Cause C — Scan bottleneck (data skew, no predicate pushdown, rowset accumulation)
  • Cause D — Join bottleneck (broadcast OOM, missing statistics)
  • Cause E — Bug localization (wrong results, executor crash)

Metric Taxonomy — Read This First

Before using any metrics, understand the two-layer observability structure:

FE-side metrics

Metric / Field Meaning
fe.audit.log → QueryTime End-to-end wall clock time for the query (ms)
fe.audit.log → ScanRows Rows scanned from storage layer
fe.audit.log → ScanBytes Bytes read from storage layer
fe.audit.log → MemCostBytes Peak memory allocated on FE side
SHOW PROC '/current_queries' → QueryId Unique query identifier
SHOW PROC '/current_queries' → ConnectionId Client connection ID
SHOW PROC '/current_queries' → ScanRows Rows scanned so far (live)
SHOW PROC '/current_queries' → ProcessRows Rows processed so far (live)
SHOW PROC '/current_queries' → ExecTime Elapsed execution time (ms)
SHOW PROC '/current_queries' → MemUsageBytes Current memory usage (live)
Profile → OLAP_SCAN_NODE Per-operator timing; entry via SHOW PROFILELIST or FE HTTP UI

BE-side metrics

Metric / Field Meaning
starrocks_be_tablet_cumulative_max_compaction_score Max cumulative compaction score on this BE — high value means rowset accumulation, which inflates scan MERGE time
Profile → MERGE (aggr/union/sort) Time spent merging rowsets at scan time; high = compaction lag
Profile → IOTime Disk I/O time at storage layer
Profile → JoinRuntimeFilterEvaluate Number of RuntimeFilters applied; 0 = no filter pushdown

Read the full file on GitHub · 715 lines

Files

What ships with it

4 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 715 lines · 73 tokens per session scan A 4a1c007ad1ba

Subscribe to this mod's changes

query is a skill published in the GitHub repository StarRocks/starrocks-debug-skills (77 stars, last pushed 5mo ago), licensed Apache-2.0. It adds 73 tokens to every session and 7,172 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories