postgresql

Design and optimize PostgreSQL queries, indexes, and migrations.

186|15|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/kid-sid/claude-spellbook --skill postgresql-kid-sid
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgresql
Source: https://github.com/kid-sid/claude-spellbook/tree/main/skills/postgresql
Command: npx skills add https://github.com/kid-sid/claude-spellbook --skill postgresql-kid-sid

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Complex PostgreSQL workloads require efficient querying, robust indexing, and safe migrations to scale with data growth.

Core Features & Use Cases

  • Advanced querying patterns: window functions, CTEs, and set-based operations for large datasets.
  • Indexing and performance tuning: design and diagnose indexes, including partial and JSONB-based indexes, plus EXPLAIN ANALYZE driven optimizations.
  • Migration and concurrency strategies: safe schema changes and upsert patterns for high-traffic apps.

Quick Start

Run practical examples to optimize a PostgreSQL workload in your project.

Frequently Asked Questions about postgresql

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

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

Diagnose slow PostgreSQL queries by running EXPLAIN ANALYZE to reveal execution plans, identify sequential scans, and evaluate index usage. This Skill provides practical patterns to interpret query plans and apply index-driven optimizations for large datasets.

What is the best way to write safe PostgreSQL migrations for high-traffic apps?

Safe PostgreSQL migrations for high-traffic apps require concurrency strategies that avoid table locks and data loss. This Skill provides patterns for schema changes and upserts to ensure reliability during deployment.

How do I optimize JSONB queries and indexing in PostgreSQL?

Optimize JSONB queries in PostgreSQL by designing partial and JSONB-based indexes to target specific keys. This Skill offers practical examples for indexing JSONB data structures and improving query performance.

Can I use CTEs and window functions for large PostgreSQL datasets?

CTEs and window functions handle complex analytical queries across large PostgreSQL datasets. This Skill demonstrates set-based operations and advanced querying patterns to compute aggregations and rankings efficiently.

When should I use PostgreSQL upsert patterns instead of standard inserts?

Use PostgreSQL upsert patterns when inserting records that might conflict with existing data, requiring conditional updates. This Skill details upsert implementations for high-traffic apps to maintain data integrity without separate queries.

Does this Skill help with designing partial indexes for PostgreSQL?

Yes, designing partial indexes is covered to optimize PostgreSQL performance by indexing only relevant rows. This Skill provides index design best practices to reduce storage overhead and accelerate filtered queries.