postgresql-optimization

Analyze PostgreSQL execution plans and schema definitions to recommend query and index optimizations.

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/tedtv1007-ctrl/milk-skills-library --skill postgresql-optimization-tedtv1007-ctrl
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgresql-optimization
Source: https://github.com/tedtv1007-ctrl/milk-skills-library/tree/main/postgresql-optimization
Command: npx skills add https://github.com/tedtv1007-ctrl/milk-skills-library --skill postgresql-optimization-tedtv1007-ctrl

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses performance bottlenecks, inefficient query patterns, and complex data modeling challenges within PostgreSQL databases.

Core Features & Use Cases

  • Query Performance Tuning: Provides actionable advice on using EXPLAIN ANALYZE, identifying slow queries, and optimizing join operations.
  • Advanced Data Modeling: Offers guidance on leveraging PostgreSQL-specific features like JSONB, range types, geometric types, and custom domains.
  • Maintenance & Monitoring: Assists in setting up effective indexing strategies, managing connection pools, and automating database maintenance tasks like VACUUM and statistics updates.

Quick Start

Use the postgresql-optimization skill to analyze the performance of the provided slow SQL query and suggest necessary index improvements.

Frequently Asked Questions about postgresql-optimization

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize a slow PostgreSQL query using EXPLAIN ANALYZE?

PostgreSQL performance tuning involves analyzing execution plans from EXPLAIN ANALYZE to identify slow queries and inefficient joins. You can resolve these bottlenecks by applying advanced indexing strategies and optimizing schema design patterns for high-concurrency environments.

What is the best way to model complex data types like JSONB in PostgreSQL?

Modeling complex data types like JSONB in PostgreSQL requires leveraging specific features such as range types and custom domains. Proper schema design patterns ensure efficient data modeling and query performance when handling advanced data structures.

Why does PostgreSQL performance degrade in high-concurrency environments?

PostgreSQL performance degrades in high-concurrency environments without proper connection pool management and database maintenance. Setting up effective indexing strategies and automating maintenance workflows like VACUUM and statistics updates resolves these concurrency bottlenecks.

Do I need database execution plans to tune PostgreSQL indexing strategies?

Yes, you need database execution plans and schema definitions to tune PostgreSQL indexing strategies effectively. Access to execution plans allows for precise query analysis, which is required to provide specific tuning recommendations for performance optimization.

How to automate database maintenance tasks like VACUUM in PostgreSQL?

To automate database maintenance tasks like VACUUM in PostgreSQL, establish maintenance workflows that manage statistics updates and connection pools. This ensures sustained query performance and prevents degradation in high-concurrency environments.