postgres-best-practices

Optimize PostgreSQL query execution with EXPLAIN ANALYZE and indexing strategies.

1|Updated May 21, 2026
One-click install
npx skills add https://github.com/hiddink-ai/hiddink-harness --skill postgres-best-practices-hiddink-ai
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-best-practices
Source: https://github.com/hiddink-ai/hiddink-harness/tree/main/templates/skills/postgres-best-practices
Command: npx skills add https://github.com/hiddink-ai/hiddink-harness --skill postgres-best-practices-hiddink-ai

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill addresses the common challenges of database performance degradation, inefficient query execution, and suboptimal schema design in PostgreSQL environments.

Core Features & Use Cases

  • Query Optimization: Provides actionable guidance on using EXPLAIN ANALYZE to identify bottlenecks and optimize slow operations.
  • Indexing Strategy: Offers expert advice on selecting the right index types (B-tree, GIN, GiST, BRIN) and maintaining them for peak performance.
  • Performance Tuning: Includes best practices for vacuuming, connection pooling, and configuration settings like shared_buffers and work_mem.
  • Use Case: A developer struggling with slow dashboard load times can use this Skill to identify missing indexes or bloated tables and apply the recommended tuning parameters.

Quick Start

Use the postgres-best-practices skill to analyze the current query execution plan and suggest indexing improvements for the slow report generation query.

Frequently Asked Questions about postgres-best-practices

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 using EXPLAIN ANALYZE to identify execution bottlenecks. This skill analyzes your query plan to pinpoint inefficient operations and suggests actionable improvements to accelerate slow database performance.

What is the best indexing strategy for high-concurrency PostgreSQL databases?

The best indexing strategy for high-concurrency PostgreSQL databases involves selecting the right index types like B-tree, GIN, GiST, or BRIN. This skill provides expert advice on choosing and maintaining indexes to ensure efficient resource utilization.

How do I tune PostgreSQL configuration settings like shared_buffers and work_mem?

Tune PostgreSQL configuration settings like shared_buffers and work_mem by applying performance best practices. This skill provides recommended tuning parameters and guidance on vacuuming and connection pooling to maximize efficient resource utilization.

When do I need to use GIN or BRIN indexes instead of B-tree in PostgreSQL?

You need to use GIN or BRIN indexes instead of B-tree in PostgreSQL when dealing with specific data patterns or large tables. This skill helps determine the right index type for your schema design to optimize query execution.

Can I use this skill to troubleshoot PostgreSQL dashboard load times?

Yes, you can use this skill to troubleshoot PostgreSQL dashboard load times. It identifies missing indexes or bloated tables causing slow performance and applies recommended tuning parameters to resolve the delays.