Skip to content
Skillpedia
Databases48k · #3859

postgresql-optimization

Makes your agent optimize the PostgreSQL database. It analyzes queries, creates indexes, and manages production performance.

What it does

This tool helps improve the speed and performance of your PostgreSQL database. It analyzes slow queries, suggests indexes, and adjusts settings to make everything run faster.

When to use it

  • ✓When your database queries are running slowly.
  • ✓When designing or adjusting tables and indexes.
  • ✓To check if database settings are optimal.

Example of what to ask your AI

“How can I optimize slow queries in my PostgreSQL database?”

Want more? Open the sections below.

How to use

The easiest way: copy the message below and paste it into Claude, ChatGPT, Cursor or any AI. It reads the skill and follows the instructions.

Skill link

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/postgresql-optimization/SKILL.md

Ready-to-paste message

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/postgresql-optimization/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
How it works

The tool analyzes how the database is performing, identifies bottlenecks, and suggests changes. It might recommend creating indexes or altering configurations to speed up data access.

Installation

Easiest way: copy the skill link and paste it into Claude, ChatGPT or Cursor asking it to follow the instructions.

In the terminal (Claude Code, Codex, Cursor), in your project folder:

npx skills add sickn33/agentic-awesome-skills --skill postgresql-optimization

Or download just the file:

curl -L https://raw.githubusercontent.com/sickn33/agentic-awesome-skills/main/plugins/agentic-awesome-skills-claude/skills/postgresql-optimization/SKILL.md -o SKILL.md
Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

PostgreSQL Optimization Workflow

Overview

Specialized workflow for PostgreSQL database optimization including query tuning, indexing strategies, performance analysis, vacuum management, and production database administration.

When to Use This Workflow

Use this workflow when:

  • Optimizing slow PostgreSQL queries
  • Designing indexing strategies
  • Analyzing database performance
  • Tuning PostgreSQL configuration
  • Managing production databases

Workflow Phases

Phase 1: Performance Assessment

Skills to Invoke

  • database-optimizer - Database optimization
  • postgres-best-practices - PostgreSQL best practices

Actions

  1. Check database version
  2. Review configuration
  3. Analyze slow queries
  4. Check resource usage
  5. Identify bottlenecks

Copy-Paste Prompts

Use @database-optimizer to assess PostgreSQL performance

Phase 2: Query Analysis

Skills to Invoke

  • sql-optimization-patterns - SQL optimization
  • postgres-best-practices - PostgreSQL patterns

Actions

  1. Run EXPLAIN ANALYZE
  2. Identify scan types
  3. Check join strategies
  4. Analyze execution time
  5. Find optimization opportunities

Copy-Paste Prompts

Use @sql-optimization-patterns to analyze and optimize queries

Phase 3: Indexing Strategy

Skills to Invoke

  • database-design - Index design
  • postgresql - PostgreSQL indexing

Actions

  1. Identify missing indexes
  2. Create B-tree indexes
  3. Add composite indexes
  4. Consider partial indexes
  5. Review index usage

Copy-Paste Prompts

Use @database-design to design PostgreSQL indexing strategy

Phase 4: Query Optimization

Skills to Invoke

  • sql-optimization-patterns - Query tuning
  • sql-pro - SQL expertise

Actions

  1. Rewrite inefficient queries
  2. Optimize joins
  3. Add CTEs where helpful
  4. Implement pagination
  5. Test improvements

Copy-Paste Prompts

Use @sql-optimization-patterns to optimize SQL queries

Phase 5: Configuration Tuning

Skills to Invoke

  • postgres-best-practices - Configuration
  • database-admin - Database administration

Actions

  1. Tune shared_buffers
  2. Configure work_mem
  3. Set effective_cache_size
  4. Adjust checkpoint settings
  5. Configure autovacuum

Copy-Paste Prompts

Use @postgres-best-practices to tune PostgreSQL configuration

Phase 6: Maintenance

Skills to Invoke

  • database-admin - Database maintenance
  • postgresql - PostgreSQL maintenance

Actions

  1. Schedule VACUUM
  2. Run ANALYZE
  3. Check table bloat
  4. Monitor autovacuum
  5. Review statistics

Copy-Paste Prompts

Use @database-admin to schedule PostgreSQL maintenance

Phase 7: Monitoring

Skills to Invoke

  • grafana-dashboards - Monitoring dashboards
  • prometheus-configuration - Metrics collection

Actions

  1. Set up monitoring
  2. Create dashboards
  3. Configure alerts
  4. Track key metrics
  5. Review trends

Copy-Paste Prompts

Use @grafana-dashboards to create PostgreSQL monitoring

Optimization Checklist

  • Slow queries identified
  • Indexes optimized
  • Configuration tuned
  • Maintenance scheduled
  • Monitoring active
  • Performance improved

Quality Gates

  • Query performance improved
  • Indexes effective
  • Configuration optimized
  • Maintenance automated
  • Monitoring in place

Related Workflow Bundles

  • database - Database operations
  • cloud-devops - Infrastructure
  • performance-optimization - Performance

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
FAQ

What are indexes?

Indexes are like the index in a book; they help the database find information faster without having to read everything.

What are slow queries?

These are commands sent to the database that take a long time to respond, affecting application speed.

Do I need to be a PostgreSQL expert to use this?

No, the tool is designed to guide you even without deep knowledge, explaining the steps and suggestions.

Details

Original description by the author

PostgreSQL database optimization workflow for query tuning, indexing strategies, performance analysis, and production database management.

repo: sickn33/agentic-awesome-skills

Popularity

GitHub stars
48k
Ranking position
#3859
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills