/fullstack-skills:database-performancefrom fullstack-skills
Use this skill for database schema review, slow queries, index strategy, migrations, relationships, data integrity, scaling, and performance optimization. Triggers on requests about SQL, EXPLAIN, N+1 queries, indexes, schema design, pagination, connection pooling, query optimization, table design, or any database-related performance concern.
Ships in fullstack-skills. 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.
Read when SKILL.md points to them.
Use this skill for database schema review, slow queries, migrations, indexes, relationships, data integrity, scaling, and performance optimization.
../../../RULES.md when available and apply it as the behavior, safety, validation, and communication baseline.EXPLAIN on production-like data rather than assuming a fixed row count.(a, b, c) supports queries on (a), (a, b), (a, b, c) but NOT (b, c).EXPLAIN.EXPLAIN ANALYZE to see actual execution plan.| Flag | Meaning | Fix |
|---|---|---|
type: ALL | Full table scan | Add index |
rows: very high | Scanning too many rows | Add/improve index |
Extra: Using filesort | Sorting not using index | Add sorted column to index |
Extra: Using temporary | Temp table created | Optimize GROUP BY/ORDER BY |
Extra: Using where with high rows | Filtering after scan | Improve index selectivity |
| No index used | Missing index | Create appropriate index |
| Pattern | Problem | Fix |
|---|---|---|
SELECT * on large tables | Wastes memory/bandwidth | Select only needed columns |
| N+1 queries | Multiplied latency | Eager load / JOIN |
| Query in loop | Unbounded query count | Batch or single query |
LIKE '%term%' | Cannot use index | Full-text search or search engine |
ORDER BY RAND() | Full table scan + sort | Application-level randomization |
COUNT(*) on huge tables | Slow on InnoDB | Use cached counters |
Unbounded SELECT | Memory/timeout | Always paginate |
OR across columns | Often prevents index use | UNION or restructure |
| Functions on indexed columns | Index bypassed | Rewrite to keep column clean |
| Implicit type coercion | Index bypassed | Match types exactly |
snake_case for tables and columns.users, orders, order_items.{singular_table}_id — e.g., user_id, order_id.is_ or has_ prefix — is_active, has_verified._at suffix — created_at, deleted_at.TINYINT vs INT, VARCHAR(100) vs TEXT.UNSIGNED for IDs and counters.DECIMAL for money — never FLOAT or DOUBLE.TIMESTAMP or DATETIME consistently — be timezone-aware.UUID for public-facing IDs, auto-increment for internal.JSON columns sparingly — they can't be indexed traditionally.ENUM only for truly fixed values — prefer lookup tables for changing lists.SET NULL when child should survive parent deletion.RESTRICT when deletion should be blocked if children exist.deleted_at index for frequently queried tables.For every migration, verify:
CREATE INDEX CONCURRENTLY).Full schema-change safety matrix and universal rules:
references/migration-safety.md(the pack-wide canonical source —deployment-devopsandmigration-upgradedefer to it).
| Method | Pros | Cons | Use When |
|---|---|---|---|
OFFSET/LIMIT | Simple, supports page numbers | Slow on large offsets | Small datasets, UI needs page numbers |
Cursor-based | Consistent performance | No page numbers, forward-only | Large datasets, infinite scroll, APIs |
Keyset | Fast, consistent | Complex for multi-column sort | Large datasets with unique sort key |
Track these metrics in production:
| Strategy | When | Complexity |
|---|---|---|
| Read replicas | Read-heavy workload | Medium |
| Caching layer (Redis) | Repeated expensive queries | Medium |
| Table partitioning | Very large tables (100M+ rows) | High |
| Vertical scaling | Quick fix, hitting limits | Low |
| Sharding | Extreme scale, multi-tenant | Very High |
| Archival | Historical data rarely accessed | Medium |
# Database Review
## Schema Issues
Data type problems, naming inconsistencies, missing constraints.
## Query Issues
Slow queries, N+1 patterns, unbounded operations.
## Index Recommendations
Missing indexes, unused indexes, composite index suggestions.
Include EXPLAIN analysis where relevant.
## Migration Risks
Locking risk, data loss risk, rollback concerns.
## Data Integrity Risks
Missing foreign keys, orphaned records, constraint gaps.
## Performance Metrics
Current query times, estimated improvement, before/after EXPLAIN.
## Scaling Concerns
Growth projections, bottleneck predictions, recommended strategies.
## Prioritized Action Plan
1. Critical fixes (data integrity, production failures)
2. Performance wins (index additions, query rewrites)
3. Schema improvements (naming, types, constraints)
4. Long-term optimizations (partitioning, caching, archival)
backend-architecture instead.What SKILL.md sets; muted values are Claude Code's defaults
Generated from the plugin's indexed repository (korwlik23/ai-skills) — no native marketplace selected
npx claudepluginhub p/korwlik23-fullstack-skills81 skills in this plugin
/ab-testingWhen the user wants to plan, design, or implement an A/B test or experiment, or build a growth experimentation program. Also use when the user mentions "A/B test," "split test," "experiment," "test this change," "variant copy," "multivariate test," "hypothesis," "should I test this," "which version is better," "test two versions," "statistical significance," "how long should I run this test," "growth experiments," "experiment velocity," "experiment backlog," "ICE score," "experimentation program," or "experiment playbook." Use this whenever someone is comparing two approaches and wants to measure which performs better, or when they want to build a systematic experimentation practice. For tracking implementation, see analytics. For page-level conversion optimization, see cro./ad-creativeWhen the user wants to generate, iterate, or scale ad creative — headlines, descriptions, primary text, or full ad variations — for any paid advertising platform. Also use when the user mentions 'ad copy variations,' 'ad creative,' 'generate headlines,' 'RSA headlines,' 'bulk ad copy,' 'ad iterations,' 'creative testing,' 'ad performance optimization,' 'write me some ads,' 'Facebook ad copy,' 'Google ad headlines,' 'LinkedIn ad text,' or 'I need more ad variations.' Use this whenever someone needs to produce ad copy at scale or iterate on existing ads. For campaign strategy and targeting, see ads. For landing page copy, see copywriting.