postgres-optimization

Identify and optimize PostgreSQL performance bottlenecks through query analysis, indexing, and configuration tuning.

Updated Jan 14, 2026
One-click install
npx skills add https://github.com/kobogithub/dotfiles --skill postgres-optimization-kobogithub
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-optimization
Source: https://github.com/kobogithub/dotfiles/tree/main/opencode/.config/opencode/skills/postgres-optimization
Command: npx skills add https://github.com/kobogithub/dotfiles --skill postgres-optimization-kobogithub

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PostgreSQL performance optimization and query tuning to reduce slow queries and improve throughput.

Core Features & Use Cases

  • Query optimization with EXPLAIN ANALYZE and plan inspection
  • Index strategy design and maintenance
  • Configuration tuning for memory, I/O, and planner settings

Quick Start

Explain and optimize a slow PostgreSQL query using EXPLAIN ANALYZE and indexing strategies.

Frequently Asked Questions about postgres-optimization

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

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

Optimize slow PostgreSQL queries by running EXPLAIN ANALYZE to inspect execution plans, identify bottlenecks like sequential scans, and apply indexing strategies to improve query throughput. This approach targets performance issues in large production tables.

What is the best way to design an indexing strategy for PostgreSQL performance tuning?

Design a PostgreSQL indexing strategy by analyzing query patterns and execution plans to deploy appropriate indexes. This reduces slow queries and improves database throughput without unnecessary overhead.

Can I tune PostgreSQL configuration settings for memory and I/O on large production tables?

Tune PostgreSQL configuration settings for memory, I/O, and planner parameters to optimize relational database workloads. This is applicable to production systems with large tables where maintenance tasks and slow queries need tuning.

How does pg_stat_statements help with PostgreSQL query optimization?

pg_stat_statements helps PostgreSQL query optimization by tracking execution statistics of queries. It identifies high-load queries and bottlenecks, allowing targeted tuning through indexing and configuration changes.

Does PostgreSQL query optimization work for small apps or is it only for production systems?

PostgreSQL query optimization works for both small apps and production systems with large tables. It scales to tune slow queries and maintenance tasks across various relational database workloads.

Why does my PostgreSQL query plan show a sequential scan and how do I fix it?

A sequential scan in your PostgreSQL query plan indicates missing indexes or unoptimized planner settings. Fix it by inspecting the plan with EXPLAIN ANALYZE and applying appropriate index strategies or configuration tuning.