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

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.

agentmods
npx agentmods add skills/starrocks/starrocks-debug-skills/query
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.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.svg" alt="Measured on agentmods" 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. Scan, not verified.
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 $0.00073 $0.07172
Opus 5 $0.00036 $0.03586
Sonnet 5 $0.00015 $0.01434
Haiku 4.5 $0.00007 $0.00717

Measured 5d ago against content hash 4a1c007ad1ba, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 5d 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.logQueryTime End-to-end wall clock time for the query (ms)
fe.audit.logScanRows Rows scanned from storage layer
fe.audit.logScanBytes Bytes read from storage layer
fe.audit.logMemCostBytes 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. 5d 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 (75 stars, last pushed 3mo ago), licensed Apache-2.0. It adds 73 tokens to every session and 7,172 once invoked, about $0.0004 per session on Opus 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

solr-query

To build and debug Solr queries: eDisMax, block join, JSON facets, kNN, explain.

griddynamics/rosetta · 27 tokens

hermes-mnemosyne

Mnemosyne is Hermes' primary local-first memory engine — SQLite with vector + FTS5 hybrid search, 19+ tools, auto-consolidation, and a standalone CLI. It's a pip-installed plugin (not a built-in toolset) discovered via $HERMESHOME/plugins/mnemosyne/.

AtlasOmnia/donna-starter · 30 tokens

doris-debug-query

Use for Apache Doris slow/hanging/timeout queries. Covers FE planner (Nereids timeout), BE Profile bottlenecks, and Exchange WaitForData / brpc E1008 on port 8060. Session vars: enableprofile, querytimeout, nereidstimeoutsecond.

apache/doris-skills · 62 tokens

data-data-virtualization

Use this skill when asked about data virtualization, Trino, Presto, Starburst, Dremio, query federation, federated query, cross-source join, pushdown, connector, or data lake query engine. This skill enforces: Trino/Presto architecture (coordinator/worker), connector patterns for query federation, query pushdown…

j4flmao/agent-skills · 121 tokens

documentdb-document-crud

Document create/read/update/delete operations on a DocumentDB (MongoDB-compatible, PostgreSQL-backed) collection via the documentdb-mcp MCP server — insert one/many, find with filter/sort/skip/limit, update/replace one/many, delete, count, and the atomic find-and-modify variants. Use when the agent must read or mutate…

Knuckles-Team/documentdb-mcp · 126 tokens

mk:database

Design and safely evolve data models, database schemas, migrations, queries, indexes, and ORM data-access boundaries. Use for data-model, migration, query, index, ORM schema, or datastore-selection tasks. Discover the existing engine and migration source before proposing syntax.

ngocsangyem/MeowKit · 56 tokens