AI Blocks › Build and ship software
Postgres performance tuner
Give it your queries or schema. Get Postgres fixes for speed, indexes and security, ranked by impact.
Postgres performance tuner is a free AI skill for the job "Build and ship software". Give the instructions to an AI assistant that supports the required files and tools, then review its output.
Free · No account · CC BY 4.0 licence · Made by sickn33 · Level: advanced
Start this task
Download the complete instructions and supporting files. Add the material the task needs in an AI that supports those files and tools.
Made by sickn33. See the original on GitHub; we copied it as it is, with its licence.
What it does
Faster Postgres without guessing. Hand over your queries or schema and get a list of fixes ranked by how much each one helps. The rules come from Supabase and are grouped into eight areas in priority order: query speed, connections, security and row-level access, schema design, locking, data access patterns, monitoring and advanced features. The skill checks your SQL and table design against each area, starting with the changes that matter most, such as missing indexes and wasteful queries. Each finding says what to change and why. It suits anyone writing or reviewing Postgres, not only Supabase users.
You give it
- Slow queries or SQL files
- Table definitions
- Query plan output (optional)
- Traffic and data size notes (optional)
You get
- Fixes ranked by impact
- Index suggestions
- Connection and pooling advice
- Security and row-level rule checks
Use it when
- A page is slow and you suspect one database query.
- You are about to ship a new schema and want a review.
- Your app runs out of database connections under load.
- You use row-level security and want to check it is safe and quick.
More for Build and ship software
- DuckDB big file query helper
- Multi-session build plan writer
- Setup wizard builder
- AI-assisted work estimator
Every build and ship software skill
Full instructions
- Add it to your AI once: download it and add the folder to Claude, ChatGPT or Codex as a skill.
- Ask for the job in your own words. Your AI opens the skill when it fits.
- It works best when your AI can read your project files.
Full instruction file
Supabase Postgres Best Practices
When to Use
Use this skill when you need postgres performance optimization and best practices from Supabase. Use this skill when writing, reviewing, or optimizing Postgres queries, schema designs, or database configurations.
Comprehensive performance optimization guide for Postgres, maintained by Supabase. Contains rules across 8 categories, prioritized by impact to guide automated query optimization and schema design.
When to Apply
Reference these guidelines when:
- Writing SQL queries or designing schemas
- Implementing indexes or query optimization
- Reviewing database performance issues
- Configuring connection pooling or scaling
- Optimizing for Postgres-specific features
- Working with Row-Level Security (RLS)
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Query Performance | CRITICAL | query- |
| 2 | Connection Management | CRITICAL | conn- |
| 3 | Security & RLS | CRITICAL | security- |
| 4 | Schema Design | HIGH | schema- |
| 5 | Concurrency & Locking | MEDIUM-HIGH | lock- |
| 6 | Data Access Patterns | MEDIUM | data- |
| 7 | Monitoring & Diagnostics | LOW-MEDIUM | monitor- |
| 8 | Advanced Features | LOW | advanced- |
How to Use
Read individual rule files for detailed explanations and SQL examples:
references/query-missing-indexes.md
references/query-partial-indexes.md
references/_sections.md
Each rule file contains:
- Brief explanation of why it matters
- Incorrect SQL example with explanation
- Correct SQL example with explanation
- Optional EXPLAIN output or metrics
- Additional context and references
- Supabase-specific notes (when applicable)
References
- https://www.postgresql.org/docs/current/
- https://supabase.com/docs
- https://wiki.postgresql.org/wiki/Performance_Optimization
- https://supabase.com/docs/guides/database/overview
- https://supabase.com/docs/guides/auth/row-level-security
Limitations
- Use this skill only when the task clearly matches its upstream product or API scope.
- Verify commands, API behavior, pricing, quotas, credentials, and deployment effects against current official documentation before making changes.
- Do not treat generated examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.