postgres-patterns

Review PostgreSQL queries, schemas, and migrations for performance and security.

Updated Jun 24, 2026
One-click install
npx skills add https://github.com/mostafa-ismail-2004/codex-plugin --skill postgres-patterns-mostafa-ismail-2004
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-patterns
Source: https://github.com/mostafa-ismail-2004/codex-plugin/tree/main/skills/postgres-patterns
Command: npx skills add https://github.com/mostafa-ismail-2004/codex-plugin --skill postgres-patterns-mostafa-ismail-2004

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you make PostgreSQL databases faster, safer, and easier to maintain by applying proven patterns for queries, indexes, schema design, and security.

Core Features & Use Cases

  • Query Optimization: Improve slow SQL with better filtering, ordering, pagination, and execution patterns.
  • Schema and Index Design: Choose appropriate data types, composite indexes, covering indexes, partial indexes, and specialized indexes for specific workloads.
  • Database Security and Operations: Implement optimized Row Level Security, connection settings, monitoring queries, and common maintenance safeguards.
  • Use Case: A product team notices slow dashboard queries and inconsistent authorization rules; this Skill helps redesign indexes and policies so the database stays fast and secure under load.

Quick Start

Ask for a PostgreSQL best-practice review of your query, schema, or migration and include the SQL and workload details you want optimized.

Frequently Asked Questions about postgres-patterns

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

FAQPage Schema
How do I optimize slow PostgreSQL queries and improve dashboard performance?

PostgreSQL query optimization improves slow dashboard queries by applying better filtering, ordering, pagination, and execution patterns. This includes redesigning indexes and evaluating index selection to reduce latency under heavy workloads.

What is the best way to design PostgreSQL schemas and choose indexes for specific workloads?

PostgreSQL schema design involves choosing appropriate data types and specialized indexes. Selecting composite, covering, or partial indexes tailored to your specific workload ensures efficient data retrieval and reduces maintenance risk.

How does Row Level Security work in PostgreSQL and when should I apply it?

Row Level Security in PostgreSQL controls data access at the row level. Apply it to enforce consistent authorization rules directly in the database, ensuring data remains secure without relying solely on application-level checks.

Can I use this PostgreSQL tuning approach for migration reviews and operational configuration?

Yes, this approach applies to SQL migration review and operational configuration. It evaluates data type choices, connection settings, and monitoring queries to maintain database performance and implement common maintenance safeguards.

Why does my PostgreSQL database experience high latency and how can I reduce maintenance risk?

High PostgreSQL latency often stems from poor index selection and inefficient execution patterns. Applying database monitoring patterns and optimized connection settings reduces latency and minimizes maintenance risk.