Query Tune

Diagnose and improve slow SQL queries using execution plans, existing indexes, bounded reads, and paired benchmarks. Use for query latency, excess statements, or lock contention; follow the project's migration process for schema changes.

9 starsDatabases

Install

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add kbdevs/query-tune --skill query-tune
Manual install
git clone --depth 1 https://github.com/kbdevs/query-tune.git /tmp/query-tune
mkdir -p ~/.claude/skills
cp -r /tmp/query-tune/skills/query-tune ~/.claude/skills/query-tune

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# Query tune

Find the work the database does that the caller does not need. Change the
smallest shared query path that removes it. Keep the caller's result contract.

## Start read-only

For an audit, read source, schema definitions, saved plans, and permitted query
metadata. Report findings before changing anything. Do not edit files, change
data or schema, run load tests, or execute queries that acquire locks until the
user authorizes that work. Use saved evidence or a plan-only command when live
execution is not authorized.

## Find the cause

Trace the caller, all uses of the query, its transaction, and the indexes that
exist. Record result order, page cursors, tenant scope, visibility rules,
collation, NULL behavior, and retry rules. Separate essential locks and writes
from advisory reads and duplicate state.

Use query digests to rank total time, rows examined, call count, and lock waits.
A frequent small query can cost more than one slow query. Use the project's
approved read-only access for production evidence. Do not collect row content
or credentials. Run ANALYZE or locking statements only where execution is
authorized; an execution plan can execute the query.

Read the plan against realistic selectivity. Record access path, index columns
used, rows read, sorts, table lookups, and where LIMIT takes effect. A LIMIT
does not bound the scan or the locks. FOR UPDATE SKIP LOCKED can lock rows it
scans while finding a result.

## Prefer the existing access path
Read the full skill on GitHub

Details

Skill name
query-tune
Path
skills/query-tune/SKILL.md
License
MIT
Repo updated
11 November 2026

FAQ

What does the Query Tune skill do?

Diagnose and improve slow SQL queries using execution plans, existing indexes, bounded reads, and paired benchmarks. Use for query latency, excess statements, or lock contention; follow the project's migration process for schema changes.

How do I install the Query Tune skill?

skills CLI (Claude Code, Cursor, Codex and more): npx skills add kbdevs/query-tune --skill query-tune. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Query Tune popular?

It lives in kbdevs/query-tune, which has 9 GitHub stars and 0 forks.

Related skills

Risingwave

9

risingwavelabs/agent-skills

Use when working with RisingWave — streaming SQL database, materialized views, sources, sinks, CDC from PostgreSQL/MySQL, Kafka ingestion, time windows (TUMBLE/HOP/SESSION), watermarks, EMIT ON WINDOW CLOSE, port 4566, risingwave-mcp, event streaming pipeline design, real-time analytics, stream processing

Databases

Disenar Arquitectura Datasets Tablas Bigquery

9

detrics/claude-skills

Diseña una arquitectura de datos de marketing en BigQuery con Detrics — decide los datasets, table groups, tablas y campos por fuente de datos, planifica las queries de consolidación (y las ejecuta vía un MCP de BigQuery si está disponible) y produce las tablas master que consumen tus dashboards. Usar cuando un usuario quiere planificar o reestructurar su data warehouse de marketing, organizar datos de múltiples clientes, decidir qué tablas y campos sincronizar, o diseñar los esquemas que alimentan sus dashboards.

Databases

Risingwave Best Practices

9

risingwavelabs/agent-skills

Use when designing RisingWave schemas, writing materialized views, configuring sources or sinks, optimizing streaming SQL performance, troubleshooting slow backfills, setting up CDC, designing time-windowed aggregations, or reviewing a RisingWave streaming pipeline

Databases

Mema Vault

33

dvcrn/openclaw-skills-marketplace

Secure credential manager using AES-256 (Fernet) encryption. Stores, retrieves, and rotates secrets using a mandatory Master Key. Use for managing API keys, database credentials, and other sensitive tokens.

Databases17

Seekdb

9

oceanbase/oceanbase-skills

Overview skill for OceanBase SeekDB. Routes to specialized sub-skills covering the full SeekDB lifecycle — install/deploy on a target machine, build from source, look up documentation, use the seekdb-cli for SQL/schema/vector ops, import CSV/Excel data, and query/export results. Use as a starting point when the user mentions seekdb, pyseekdb, "install seekdb", "build seekdb", "seekdb docs", "seekdb-cli", "import to seekdb", "query seekdb", or wants a lightweight standalone OceanBase-compatible database.

Databases

Mema

33

dvcrn/openclaw-skills-marketplace

Mema's personal brain - SQLite metadata index for documents and Redis short-term context buffer. Use for organizing workspace knowledge paths and managing ephemeral session state.

Databases17

Browse the most popular Claude skills, all databases skills, or write your own with the skills generator.