linktogo/maggie/query-performance
Claude Code and agent skill by linktogo/maggie
- community
Checking that the SKILL.md file is still in the repository.
Diagnose and fix slow PostgreSQL queries with indexes and EXPLAIN
Install
npx vskill@latest install linktogo/maggie/query-performanceSKILL.md
The same SKILL.md was published earlier as linktogo/maggie/query-performance.
PostgreSQL query performance
Before optimizing, measure. Guessing at indexes wastes time and disk.
Diagnose
- Run
EXPLAIN (ANALYZE, BUFFERS)on the real query with realistic parameters. - Watch for
Seq Scanon large tables in the hot path, highrowsestimates
that diverge from actual, and nested-loop joins over big row counts.
- Reproduce against production-sized data — plans flip as tables grow.
Fix
- Index the columns used in
WHERE,JOIN, andORDER BY. A composite index
order matters: most selective / equality columns first, range columns last.
- Add partial indexes for queries that always filter the same predicate
(WHERE deleted_at IS NULL).
- Select only the columns you need; avoid
SELECT *in application queries. - Kill N+1 patterns: fetch related rows in one query with a join or
WHERE id = ANY($1) rather than a query per parent row.
- Keep transactions short; long-running ones bloat dead tuples and block
VACUUM.
Verify
Re-run EXPLAIN ANALYZE after the change and confirm the plan uses the index and the total time dropped. An index that the planner ignores is dead weight — remove it.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/postgres/query-performance/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/linktogo/maggie/query-performance)