cyberneticlibrary

Optimize PostgreSQL queries and schemas

postgres-patternsskillsetup L20
Sheshiyer/skill-clusters
What it does

Apply PostgreSQL best practices for query optimization, schema design, and security

Best for

Writing production PostgreSQL queries and schemas with Supabase best practices for performance and security.

Inputs
  • · SQL query, schema design, performance issue, or security requirement
Outputs
  • · Optimized query with index suggestions, proper schema pattern, RLS policy example, connection pooling config
Requires
  • · PostgreSQL server
  • · Supabase (optional, for hosted PostgreSQL)
Preconditions

PostgreSQL database accessible; schema access available

Failure modes
  • · Index hints ignored; slow queries remain
  • · RLS policy too loose/tight
  • · Connection pool misconfigured
Trust signals
  • · Index cheat sheet by query pattern
  • · Data type quick reference
  • · Composite index order discipline