postgres-best-practices

Optimize PostgreSQL queries, schemas, and database configuration.

10|3|Updated Mar 14, 2025
One-click install
npx skills add https://github.com/Mentor-Wizard/mentor-wizard-webapp --skill postgres-best-practices-mentor-wizard
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-best-practices
Source: https://github.com/Mentor-Wizard/mentor-wizard-webapp/tree/main/.claude/skills/postgres-best-practices
Command: npx skills add https://github.com/Mentor-Wizard/mentor-wizard-webapp --skill postgres-best-practices-mentor-wizard

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill addresses common performance bottlenecks in PostgreSQL databases, helping developers write more efficient queries, design better schemas, and configure their databases for optimal speed and stability.

Core Features & Use Cases

  • Query Optimization: Provides rules for indexing, query planning, and avoiding slow scans.
  • Schema Design: Offers best practices for data types, primary keys, and partitioning.
  • Connection Management: Guides on pooling, timeouts, and limits to prevent resource exhaustion.
  • Use Case: When reviewing a slow-running SQL query, consult this Skill to identify potential issues like missing indexes or inefficient joins, and get concrete examples of how to fix them.

Quick Start

Use the postgres-best-practices skill to find rules for optimizing slow SQL queries.

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 Postgres queries and avoid sequential table scans?

To optimize slow Postgres queries, apply proper indexing rules and analyze query plans to eliminate inefficient joins and sequential scans. This Skill provides concrete rules for indexing and query planning to resolve these bottlenecks.

What are the best practices for Postgres schema design and data partitioning?

Postgres schema design best practices involve selecting optimal data types, defining efficient primary keys, and implementing table partitioning. This Skill offers comprehensive rules to structure your schema for better data access patterns and speed.

How can I prevent Postgres connection pool exhaustion and manage database timeouts?

Prevent Postgres connection pool exhaustion by configuring connection limits, pooling mechanisms, and explicit timeouts. This Skill guides you through connection management rules to avert resource exhaustion and maintain database stability.

Does this database optimization guidance cover Postgres security and concurrency configurations?

Yes, this database optimization guidance covers Postgres security and concurrency configurations. It provides best practices for managing concurrent data access patterns and securing your database alongside performance tuning.

When should I not use certain Postgres advanced features for performance optimization?

You should avoid using Postgres advanced features when they introduce unnecessary overhead or conflict with your specific data access patterns. This Skill outlines constraints and monitoring rules to identify when specific optimizations degrade performance.