database-operations

Optimize PostgreSQL schema design, migrations, and query performance.

Updated Feb 26, 2026
One-click install
npx skills add https://github.com/gabi-agent/openretro --skill database-operations-gabi-agent
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: database-operations
Source: https://github.com/gabi-agent/openretro/tree/main/skills/database-operations
Command: npx skills add https://github.com/gabi-agent/openretro --skill database-operations-gabi-agent

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Comprehensive guidance for designing scalable PostgreSQL schemas, writing safe migrations, and optimizing queries to achieve better performance and reliability across complex systems.

Core Features & Use Cases

  • Schema design patterns including users, audit trails, soft deletes, and full-text search.
  • Query optimization practices: EXPLAIN ANALYZE, indexing strategies, partial indexes, and N+1 reduction.
  • Migration patterns: zero-downtime changes, safe column additions, renames, and partitioning.

Quick Start

Analyze your current PostgreSQL schema and implement a safe, zero-downtime migration plan for performance improvements.

Frequently Asked Questions about database-operations

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

FAQPage Schema
How do I perform zero-downtime PostgreSQL schema migrations?▼

Zero-downtime PostgreSQL migrations require safe column additions, renames, and partitioning with robust rollback plans. Apply safe patterns to execute schema changes without service interruption, satisfying measure-first analysis and reliability requirements.

What's the best way to optimize slow PostgreSQL queries?▼

Optimize slow PostgreSQL queries using EXPLAIN ANALYZE, implementing indexing strategies and partial indexes, and reducing N+1 query patterns to achieve better performance and reliability across complex systems.

How do I design a PostgreSQL schema with audit trails and soft deletes?▼

PostgreSQL schema design patterns for audit trails and soft deletes structure data to preserve history and enable safe record removal. These patterns support scalable databases alongside full-text search and user management structures.

Does this database operations guidance work with EF Core migrations?▼

Yes, the database operations guidance applies directly to EF Core migrations, providing safe patterns and zero-downtime change strategies for schema design, indexing, and partitioning within the Entity Framework Core environment.

When should I use partial indexes in PostgreSQL?▼

Partial indexes in PostgreSQL optimize query performance by indexing only rows matching a specific condition. Use them during query optimization and indexing strategy implementation to reduce storage overhead and improve access speed for targeted queries.

How do I reduce N+1 query problems in PostgreSQL?▼

Reduce N+1 query problems in PostgreSQL through query optimization practices that analyze execution paths with EXPLAIN ANALYZE. Implement proper indexing strategies and caching to eliminate redundant database calls and improve performance.