postgres-best-practices

Provide PostgreSQL best-practice guidelines for query performance and schema design.

1|Updated Sep 11, 2025
One-click install
npx skills add https://github.com/Dhumitech/DHUMI-AI-RESOURCE --skill postgres-best-practices-dhumitech
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-best-practices
Source: https://github.com/Dhumitech/DHUMI-AI-RESOURCE/tree/main/AI-Engineer-planner-Skills/02-data/postgres-best-practices
Command: npx skills add https://github.com/Dhumitech/DHUMI-AI-RESOURCE --skill postgres-best-practices-dhumitech

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PostgreSQL optimization and advanced features guidance to help developers and DBAs improve query performance, design efficient schemas, and manage connections.

Core Features & Use Cases

  • Rules and categories for prioritizing performance improvements across query performance, connection management, security/RLS, schema design, concurrency & locking, data access patterns, monitoring & diagnostics, and advanced features.
  • Practical examples showing how to tune queries, create effective indexes, leverage JSONB, CTEs, and window functions, and optimize connection pooling.
  • Use Case: When a Postgres deployment experiences slow queries or poor indexing, follow the guide to structure improvements and validate results with metrics.

Quick Start

Review the rule-set and apply the top-priority recommendations to your Postgres workload.

Frequently Asked Questions about postgres-best-practices

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

FAQPage Schema
How do I tune PostgreSQL queries for better performance?

Tune PostgreSQL performance by applying prioritized best-practice rules for query optimization, schema design, and indexing. The guide provides practical examples to structure improvements and validate results with metrics.

What is the best way to design indexes for a slow PostgreSQL deployment?

Design effective indexes by following categorized performance rules that address data access patterns and query performance. Apply the top-priority recommendations to your Postgres workload and validate the results with metrics.

How do I use JSONB, CTEs, and window functions efficiently in PostgreSQL?

Leverage JSONB, CTEs, and window functions efficiently by applying practical tuning examples and best-practice guidelines. The ruleset covers advanced features to optimize data access patterns and query execution.

How do I optimize connection management and pooling in PostgreSQL?

Optimize connection management by applying best-practice rules for connection pooling and concurrency. The guide provides targeted recommendations to improve reliability and speed across your Postgres deployments.

Does this PostgreSQL tuning guide cover security and row-level security policies?

Yes, the guide includes performance and design rules for security and Row-Level Security (RLS). It provides categorized recommendations covering security alongside schema design, concurrency, and monitoring.

When should I not use CTEs for PostgreSQL query optimization?

Apply CTEs carefully by reviewing the guide's best-practice rules for advanced features and data access patterns. The ruleset helps prioritize performance improvements and validate query efficiency with metrics.