postgresql

Design PostgreSQL schemas and optimize query performance with EXPLAIN ANALYZE.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/JuanJoseGonGi/skills --skill postgresql-juanjosegongi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgresql
Source: https://github.com/JuanJoseGonGi/skills/tree/main/postgresql
Command: npx skills add https://github.com/JuanJoseGonGi/skills --skill postgresql-juanjosegongi

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses the complexities of designing efficient PostgreSQL schemas and optimizing query performance, ensuring robust and fast database operations.

Core Features & Use Cases

  • Schema Design: Best practices for tables, columns, data types, and constraints.
  • Indexing Strategies: Guidance on choosing and implementing appropriate index types (B-tree, GIN, GiST, etc.).
  • Query Optimization: Techniques for writing performant SQL, diagnosing slow queries with EXPLAIN ANALYZE, and tuning database configurations.
  • Advanced Features: Covers partitioning, JSONB, Row-Level Security (RLS), and common extensions.
  • Use Case: When designing a new database schema for a high-traffic application, or when encountering slow-running queries that need performance tuning.

Quick Start

Use the postgresql skill to design a new table schema for user accounts, including primary keys and essential constraints.

Frequently Asked Questions about postgresql

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

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

Optimize slow PostgreSQL queries by running EXPLAIN ANALYZE to diagnose execution plans, then apply performance tuning techniques like rewriting SQL and adjusting database configurations to resolve bottlenecks.

What are the best indexing strategies for PostgreSQL schema design?

PostgreSQL indexing strategies involve choosing appropriate index types like B-tree, GIN, or GiST based on query patterns, ensuring efficient data retrieval and minimizing overhead during schema design.

How do I design a PostgreSQL schema for a high-traffic application?

Design a high-traffic PostgreSQL schema by applying best practices for tables, columns, data types, and constraints, while incorporating advanced features like partitioning to manage large datasets efficiently.

When should I use JSONB or partitioning in PostgreSQL?

Use PostgreSQL JSONB for flexible document storage within relational structures, and apply partitioning to divide large tables into manageable segments, enhancing query performance and scalability.

What PostgreSQL constraints and data types should I use for robust schema design?

Robust PostgreSQL schema design relies on selecting specific data types and applying constraints to enforce data integrity, preventing invalid entries and ensuring reliable database operations.

How do I implement Row-Level Security in PostgreSQL?

Implement PostgreSQL Row-Level Security (RLS) by configuring policies that restrict data access at the row level, ensuring users only retrieve rows matching defined security criteria.