Source profileQuality 91/100

Jeffallan/claude-skills/skills/database-optimizer/SKILL.md

database-optimizer

Optimizes database queries and improves performance across PostgreSQL and MySQL systems. Use when investigating slow queries, analyzing execution plans, or optimizing database performance. Invoke for index design, query rewrites, configuration tuning, partitioning strategies, lock contention resolution.

Source repository stars
10,762
Declared platforms
0
Static risk flags
0
Last source update
2026-05-20
Source checked
2026-07-28

Decision brief

What it does—and where it fits

Senior database optimizer with expertise in performance tuning, query optimization, and scalability across multiple database systems.

Best for

  • Analyzing slow queries and execution plans
  • Designing optimal index strategies
  • Tuning database configuration parameters

Not for

  • Tasks that require unconfirmed production actions or broad system permissions.
  • Environments where the pinned source and install steps cannot be inspected.

Compatibility matrix

Platform support, with evidence labels

PlatformStatusEvidenceWhat to check
CodexNot declaredNo explicit evidencePortability before use
Claude CodeNot declaredNo explicit evidencePortability before use
CursorNot declaredNo explicit evidencePortability before use
Gemini CLINot declaredNo explicit evidencePortability before use
Open the compatibility checker

Installation

Inspect first. Install second.

The source command is displayed only when detected. A safe inspection prompt is always available so your agent can explain every action before execution.

Source-detected install commandSource
npx skills add https://github.com/Jeffallan/claude-skills --skill "skills/database-optimizer"
Safe inspection promptEditorial

Inspect the Agent Skill "database-optimizer" from https://github.com/Jeffallan/claude-skills/blob/e8be415bc94d8d6ebddc2fb50e5d03c6e27d4319/skills/database-optimizer/SKILL.md at commit e8be415bc94d8d6ebddc2fb50e5d03c6e27d4319. List every install step, command, network request, credential, file read/write, external action, and rollback step. Explain whether it fits my task. Do not install or execute anything until I approve.

Workflow

What the source asks the agent to do

  1. 01

    Core Workflow

    1. Analyze Performance — Capture baseline metrics and run EXPLAIN ANALYZE before any changes 2. Identify Bottlenecks — Find inefficient queries, missing indexes, config issues 3. Design Solutions — Create index strategies, query rewrites, schema improvements 4. Implement Changes…

    Analyze Performance — Capture baseline metrics and run EXPLAIN ANALYZE before any changesIdentify Bottlenecks — Find inefficient queries, missing indexes, config issuesDesign Solutions — Create index strategies, query rewrites, schema improvements
  2. 02

    When to Use This Skill

    Analyzing slow queries and execution plans

    Analyzing slow queries and execution plansDesigning optimal index strategiesTuning database configuration parameters
  3. 03

    Reference Guide

    Load detailed guidance based on context:

    Load detailed guidance based on context:
  4. 04

    Common Operations & Examples

    Review the “Common Operations & Examples” section in the pinned source before continuing.

    Review and apply the “Common Operations & Examples” source section.
  5. 05

    Identify Top Slow Queries (PostgreSQL)

    Review the “Identify Top Slow Queries (PostgreSQL)” section in the pinned source before continuing.

    Review and apply the “Identify Top Slow Queries (PostgreSQL)” source section.

Permission review

Static risk signals and limitations

No configured static risk pattern was detected

This is not proof of safety. Runtime behavior, indirect dependencies, and hidden external systems are outside the static scan.

Evidence record

Why each signal appears

EvidenceSourceComputedTestedEditorial
SignalValueEvidence typeMeaning
Quality score91/100ComputedDocumentation, specificity, maintenance, and trust rules
Repository stars10,762SourceRepository attention, not individual Skill quality
Compatibility0 platformsSourceDeclared in the catalog source record
Usage guideautomated source guideEditorialGenerated or reviewed according to the visible evidence level

Pinned source

Provenance and original SKILL.md

Repository
Jeffallan/claude-skills
Skill path
skills/database-optimizer/SKILL.md
Commit
e8be415bc94d8d6ebddc2fb50e5d03c6e27d4319
License
MIT
Collected
2026-07-28
Default branch
main
View the original SKILL.md

Database Optimizer

Senior database optimizer with expertise in performance tuning, query optimization, and scalability across multiple database systems.

When to Use This Skill

  • Analyzing slow queries and execution plans
  • Designing optimal index strategies
  • Tuning database configuration parameters
  • Optimizing schema design and partitioning
  • Reducing lock contention and deadlocks
  • Improving cache hit rates and memory usage

Core Workflow

  1. Analyze Performance — Capture baseline metrics and run EXPLAIN ANALYZE before any changes
  2. Identify Bottlenecks — Find inefficient queries, missing indexes, config issues
  3. Design Solutions — Create index strategies, query rewrites, schema improvements
  4. Implement Changes — Apply optimizations incrementally with monitoring; validate each change before proceeding to the next
  5. Validate Results — Re-run EXPLAIN ANALYZE, compare costs, measure wall-clock improvement, document changes

⚠️ Always test changes in non-production first. Revert immediately if write performance degrades or replication lag increases.

Reference Guide

Load detailed guidance based on context:

TopicReferenceLoad When
Query Optimizationreferences/query-optimization.mdAnalyzing slow queries, execution plans
Index Strategiesreferences/index-strategies.mdDesigning indexes, covering indexes
PostgreSQL Tuningreferences/postgresql-tuning.mdPostgreSQL-specific optimizations
MySQL Tuningreferences/mysql-tuning.mdMySQL-specific optimizations
Monitoring & Analysisreferences/monitoring-analysis.mdPerformance metrics, diagnostics

Common Operations & Examples

Identify Top Slow Queries (PostgreSQL)

-- Requires pg_stat_statements extension
SELECT query,
       calls,
       round(total_exec_time::numeric, 2)  AS total_ms,
       round(mean_exec_time::numeric, 2)   AS mean_ms,
       round(stddev_exec_time::numeric, 2) AS stddev_ms,
       rows
FROM   pg_stat_statements
ORDER  BY mean_exec_time DESC
LIMIT  20;

Capture an Execution Plan

-- Use BUFFERS to expose cache hit vs. disk read ratio
EXPLAIN (ANALYZE, BUFFERS, FORMAT TEXT)
SELECT o.id, c.name
FROM   orders o
JOIN   customers c ON c.id = o.customer_id
WHERE  o.status = 'pending'
  AND  o.created_at > now() - interval '7 days';

Reading EXPLAIN Output — Key Patterns to Find

PatternSymptomTypical Remedy
Seq Scan on large tableHigh row estimate, no filter selectivityAdd B-tree index on filter column
Nested Loop with large outer setExponential row growth in inner loopConsider Hash Join; index inner join key
cost=... rows=1 but actual rows=50000Stale statisticsRun ANALYZE <table>;
Buffers: hit=10 read=90000Low buffer cache hit rateIncrease shared_buffers; add covering index
Sort Method: external mergeSort spilling to diskIncrease work_mem for the session

Create a Covering Index

-- Covers the filter AND the projected columns, eliminating a heap fetch
CREATE INDEX CONCURRENTLY idx_orders_status_created_covering
    ON orders (status, created_at)
    INCLUDE (customer_id, total_amount);

Validate Improvement

-- Before optimization: save plan & timing
EXPLAIN (ANALYZE, BUFFERS) <query>;   -- note "Execution Time: X ms"

-- After optimization: compare
EXPLAIN (ANALYZE, BUFFERS) <query>;   -- target meaningful reduction in cost & time

-- Confirm index is actually used
SELECT indexname, idx_scan, idx_tup_read, idx_tup_fetch
FROM   pg_stat_user_indexes
WHERE  relname = 'orders';

MySQL: Find Slow Queries

-- Inspect slow query log candidates
SELECT * FROM performance_schema.events_statements_summary_by_digest
ORDER  BY SUM_TIMER_WAIT DESC
LIMIT  20;

-- Execution plan
EXPLAIN FORMAT=JSON
SELECT * FROM orders WHERE status = 'pending' AND created_at > NOW() - INTERVAL 7 DAY;

Constraints

MUST DO

  • Capture EXPLAIN (ANALYZE, BUFFERS) output before optimizing — this is the baseline
  • Measure performance before and after every change
  • Create indexes with CONCURRENTLY (PostgreSQL) to avoid table locks
  • Test in non-production; roll back if write performance or replication lag worsens
  • Document all optimization decisions with before/after metrics
  • Run ANALYZE after bulk data changes to refresh statistics

MUST NOT DO

  • Apply optimizations without a measured baseline
  • Create redundant or unused indexes
  • Make multiple changes simultaneously (impossible to attribute impact)
  • Ignore write amplification caused by new indexes
  • Neglect VACUUM / statistics maintenance

Output Templates

When optimizing database performance, provide:

  1. Performance analysis with baseline metrics (query time, cost, buffer hit ratio)
  2. Identified bottlenecks and root causes (with EXPLAIN evidence)
  3. Optimization strategy with specific changes
  4. Implementation SQL / config changes
  5. Validation queries to measure improvement
  6. Monitoring recommendations

Documentation

Alternatives

Compare before choosing

Computed 997

event4u-app/agent-config

design-review

Use when the user says "review the design", "check the UI", or wants a comprehensive UI/UX review. Uses a 7-phase methodology covering interaction, responsiveness, accessibility, and more.

Computed 9827

MoizIbnYousaf/marketing-cli

higgsfield-generate

Use when the user wants to generate an image or video via Higgsfield AI. Covers 30+ models: Soul V2, Seedance 2.0, Kling 3.0, Veo 3.1, GPT Image 2, Nano Banana 2. Also covers Marketing Studio — branded ad video/image with avatars and products. Use whenever: "generate an image", "make a video", "animate this photo", "image-to-video", "img2vid", "edit this image with AI", "produce a clip", "create an ad", "make a UGC video", "marketing video", "brand video", "TV spot", "import product from URL", "

Computed 9637,126

github/awesome-copilot

arize-evaluator

Handles LLM-as-judge evaluation workflows on Arize including creating/updating evaluators, running evaluations on spans or experiments, managing tasks, trigger-run operations, column mapping, and continuous monitoring. Use when the user mentions create evaluator, LLM judge, hallucination, faithfulness, correctness, relevance, run eval, score spans, score experiment, trigger-run, column mapping, continuous monitoring, or improve evaluator prompt.

Computed 9631,966

K-Dense-AI/scientific-agent-skills

neuropixels-analysis

Analyze Neuropixels extracellular recordings end-to-end with SpikeInterface. Covers loading SpikeGLX/Open Ephys/NWB data, preprocessing, drift/motion correction, Kilosort4 (and CPU) spike sorting, quality metrics, and unit curation (threshold-based, model-based UnitRefine, and AI-assisted visual review). Use when working with Neuropixels 1.0/2.0 recordings, spike sorting, or extracellular electrophysiology analysis.