/gabbe-data:sql-optimizationfrom gabbe-data
Tunes slow SQL queries by reading EXPLAIN ANALYZE, designing indexes, fixing N+1 problems, and optimizing pagination and transactions.
Ships in gabbe-data. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
This skill focuses on ensuring database interactions are performant and scalable.
WHERE, ORDER BY, GROUP BY need indexes.(last_name, first_name) supports lookup by last_name OR last_name + first_name, but NOT by first_name alone.EXPLAIN ANALYZE)Always run EXPLAIN ANALYZE on suspect queries.
| Output Term | Meaning | Action |
|---|---|---|
| Seq Scan / Full Table Scan | Reading every row. | Bad (unless table is tiny). Add an index. |
| Index Scan | Reading index + looking up heap. | Good. |
| Index Only Scan | Reading only index. | Best. (Covering Index). |
| Nested Loop | Looping for joins. | Fine for small datasets. Bad for large. |
| Hash Join | Building hash table for join. | Good for large datasets. |
SELECT * FROM usersSELECT id, name FROM usersJOIN or eager loading (ORM specific: include, with).OFFSET 1000000 is slow (DB scans 1M rows then discards).WHERE id > last_seen_id LIMIT 10. O(1) performance.author_name on posts table).VARCHAR(255) vs TEXT (Postgres treats similar, MySQL differs).INT vs BIGINT.JSONB (Postgres) for unstructured data, but don't overuse it.VACUUM ANALYZE (Postgres) regularly to update planner statistics.DROP INDEX and run it only after the human confirms.A list of query and index changes with the before and after EXPLAIN output; index changes go through db-migration.skill.
EXPLAIN ANALYZE runs the query: use it only on SELECT statements, never on INSERT, UPDATE or DELETE against real data.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
5 skills in this plugin
/data-engineeringPipeline and warehouse design — ELT, orchestration, dbt models, idempotent loads, data quality checks and PII handling. Use when data must be moved or transformed for analytics, or when a pipeline is unreliable./data-governanceData classification, lineage, integrity and retention rules with a deletion workflow. Use when handling personal or confidential data, or when asked where a value came from or how long data may be kept./db-migrationSchema change workflow — forward and rollback migration, compatibility check, test on a copy and safe rename or drop. Use when a table, column, index or constraint must change.npx claudepluginhub andreibesleaga/gabbe --plugin gabbe-dataOther plugins' skills for the same job