postgres-optimizer

Guide PostgreSQL indexing, schema design, and safe migrations.

Updated Oct 31, 2024
One-click install
npx skills add https://github.com/thesammykins/dotfiles --skill postgres-optimizer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-optimizer
Source: https://github.com/thesammykins/dotfiles/tree/main/.agents/skills/postgres-optimizer
Command: npx skills add https://github.com/thesammykins/dotfiles --skill postgres-optimizer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PostgreSQL tuning expert guidance to maximize performance through thoughtful indexing, modern schema design, and safe migration practices.

Core Features & Use Cases

  • Indexing strategies: design covering and partial indexes, UUIDv7 primary keys, and appropriate timestamptz usage.
  • Query analysis and optimization: use EXPLAIN ANALYZE (BUFFERS) to identify bottlenecks and verify improvements.
  • Migration planning: provide safe rollout patterns, rollback strategies, and validation checks during schema changes.
  • Data modeling guidance: recommend when to use JSONB vs relational structures and how to cap growth with proper constraints.

Quick Start

Propose an optimization plan for a slow PostgreSQL query on a production database.

Frequently Asked Questions about postgres-optimizer

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

FAQPage Schema
How do I optimize slow PostgreSQL queries in a production database?

PostgreSQL indexing strategies improve performance by designing covering and partial indexes, enforcing UUIDv7 primary keys, and indexing foreign keys to accelerate query execution across OLTP and analytical workloads.

What is the best way to plan safe PostgreSQL schema migrations?

Safe PostgreSQL schema migrations require rollout patterns, rollback strategies, and validation checks during changes to prevent downtime and ensure data integrity across distributed systems.

When do I need UUIDv7 primary keys and timestamptz in PostgreSQL schema design?

You need UUIDv7 primary keys and timestamptz in PostgreSQL schema design when modernizing databases to ensure time-ordered unique identifiers and accurate timezone-aware timestamp tracking.

Should I use JSONB or relational structures for PostgreSQL data modeling?

PostgreSQL data modeling guidance recommends choosing JSONB for flexible schemas and relational structures for strict integrity, using proper constraints to cap growth and enforce data limits.

Can I apply PostgreSQL optimization techniques to distributed systems?

PostgreSQL optimization applies to distributed systems by providing safe migration planning, indexing strategies, and query analysis to maintain performance across OLTP and analytical workloads.