postgresql-optimization

Diagnose PostgreSQL bottlenecks and prescribe query optimization, indexing, partitioning, and configuration tuning.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/luke-selrai/openclaw-workshop-kit --skill postgresql-optimization-luke-selrai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgresql-optimization
Source: https://github.com/luke-selrai/openclaw-workshop-kit/tree/main/skills/postgresql-optimization
Command: npx skills add https://github.com/luke-selrai/openclaw-workshop-kit --skill postgresql-optimization-luke-selrai

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PostgreSQL performance can degrade under heavy load due to slow queries, missing indexes, and misconfigured resources. This skill provides structured guidance to diagnose, tune, and maintain high-performance PostgreSQL deployments in production.

Core Features & Use Cases

  • EXPLAIN ANALYZE interpretation and query plan remediation for complex workloads.
  • Indexing strategies (B-tree, GIN, GiST, BRIN) and partial/covering indexes to reduce I/O.
  • Configuration tuning for memory, autovacuum, WAL, and connection pooling to sustain concurrency.
  • Partitioning, maintenance, and monitoring practices for large datasets and high-availability setups.
  • Production-grade best practices for migration, upgrades, and risk mitigation.

Quick Start

Run an initial EXPLAIN ANALYZE on a slow query, then implement recommended indexes and config changes to improve performance.

Frequently Asked Questions about postgresql-optimization

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

FAQPage Schema
How do I interpret EXPLAIN ANALYZE output to fix slow PostgreSQL queries?

PostgreSQL query plan remediation involves reading EXPLAIN ANALYZE output to identify sequential scans and high-cost operations. This skill diagnoses bottlenecks in complex workloads and prescribes targeted query refactoring to reduce latency.

What is the best indexing strategy for large PostgreSQL tables with high concurrency?

Indexing strategies for large PostgreSQL tables include selecting B-tree, GIN, GiST, or BRIN indexes. This skill prescribes partial and covering indexes to reduce I/O and sustain high concurrency in production-grade deployments.

When do I need table partitioning for PostgreSQL performance tuning?

PostgreSQL partitioning is needed for managing large datasets and high-availability setups. This skill provides partitioning strategies and maintenance practices to achieve higher throughput and lower latency.

How do I configure PostgreSQL connection pooling and autovacuum for heavy load?

PostgreSQL configuration tuning for heavy load targets memory, autovacuum, WAL, and connection pooling. This skill provides structured guidance to tune these settings and sustain concurrency under heavy production load.

Can I use this PostgreSQL optimization approach for production upgrades and migrations?

PostgreSQL optimization includes production-grade best practices for migration, upgrades, and risk mitigation. This skill provides maintenance and monitoring practices to ensure high availability during these operations.