AI Blocks › Build and ship software
Postgres query tuner
Share your queries or schema. Get faster Postgres with better indexes, types and settings, ranked by impact.
Postgres query 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
Made by sickn33. See the original on GitHub; we copied it as it is, with its licence.
What it does
Share a slow query or a table design and get back a faster version with the reason for each change. Fixes are ranked from biggest gain to smallest. The skill works through Supabase's Postgres rules in order of impact. It looks first at query performance, then connection handling and row-level security, then schema choices such as column types and keys. After that come locking, data access patterns and monitoring. For each issue it shows the before and after SQL, so you can test the change yourself. It is useful when reviewing code before release or hunting a single slow endpoint.
You give it
- Queries or schema files
- Table sizes (optional)
- EXPLAIN output (optional)
- Database settings (optional)
You get
- Rewritten SQL
- Index and type recommendations
- Settings changes
- A ranked list of issues
Use it when
- One report query takes ten seconds.
- Your column types waste space or block indexes.
- You need to check indexes before a release.
- Locks are blocking writes at peak times.
How to use it
- 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.