postgres-practices

Optimize Postgres queries, schema, connections, and security with best practices.

7|2|Updated Jan 28, 2026
One-click install
npx skills add https://github.com/LuisSambrano/antigravity-config --skill postgres-practices
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: postgres-practices
Source: https://github.com/LuisSambrano/antigravity-config/tree/main/skills/3-web/postgres-practices
Command: npx skills add https://github.com/LuisSambrano/antigravity-config --skill postgres-practices

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill addresses common performance bottlenecks and security vulnerabilities in PostgreSQL databases, ensuring efficient and reliable data management.

Core Features & Use Cases

  • Query Optimization: Identifies and suggests fixes for slow queries, missing indexes, and inefficient query plans.
  • Schema Design: Provides best practices for data types, primary keys, and partitioning.
  • Connection Management: Guides on setting up connection pooling and timeouts to handle high concurrency.
  • Security: Enforces least privilege and Row-Level Security (RLS) policies.
  • Use Case: When encountering slow database queries, use this Skill to analyze the query plan, identify missing indexes, and apply best practices for optimization.

Quick Start

Use the postgres-practices skill to find missing indexes on the 'orders' table.

Frequently Asked Questions about postgres-practices

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

FAQPage Schema
How do I optimize slow PostgreSQL queries and find missing indexes?

To optimize slow PostgreSQL queries, analyze the query plan to identify missing indexes and inefficient execution paths, then apply best practices and correct SQL patterns to improve database query performance.

What are the best practices for PostgreSQL schema design and partitioning?

PostgreSQL schema design best practices involve selecting optimal data types, defining efficient primary keys, and implementing partitioning strategies to ensure scalable data access patterns and reliable database management.

How does connection pooling affect PostgreSQL performance under high concurrency?

Connection pooling improves PostgreSQL performance under high concurrency by managing connection limits and setting timeouts, which prevents resource exhaustion and ensures reliable database access during traffic spikes.

How do I enforce Row-Level Security policies in a PostgreSQL database?

To enforce Row-Level Security in a PostgreSQL database, apply least privilege principles and configure RLS policies to restrict data access patterns, ensuring robust database security and vulnerability prevention.

Does this PostgreSQL optimization guidance work for Supabase environments?

Yes, this PostgreSQL optimization guidance explicitly targets Supabase and other Postgres environments, providing tailored best practices for query performance, connection management, and security configurations.

Why are my PostgreSQL queries still slow after adding indexes?

PostgreSQL queries may remain slow after adding indexes due to inefficient query plans, poor schema design, or concurrency bottlenecks, requiring comprehensive performance optimization and monitoring to resolve.