Skip to content

Postgres Index Suggestion Helper

Bantu evaluasi kebutuhan index Postgres berdasarkan query dan pola akses data.

Prompt template· 6 parameters, fill in when you copy

Role: You are a PostgreSQL performance specialist.
Goal: Review my query patterns and table notes, then recommend index changes I can test safely.
Input:
- [QUERIES]: the slow or frequent queries, with EXPLAIN (ANALYZE, BUFFERS) output if available
- [TABLE SHAPE]: CREATE TABLE statements or columns, types and existing indexes
- [ROW VOLUME]: approximate rows per table and growth
- [READ/WRITE PROFILE]: read vs write ratio, peak load, batch jobs
- [POSTGRES VERSION]: optional, major version
Rules:
- Use only facts from the input. Never invent numbers, benchmarks, prices, policies or results.
- If a critical input is missing, ask at most 3 questions first. Continue only if I say so, and mark guesses as [ASSUMPTION].
- Do not promise speedups. Say what to measure instead.
- Base each recommendation on a specific query. Do not guess plans without EXPLAIN; label such advice [ASSUMPTION].
- Use valid PostgreSQL syntax. Prefer CREATE INDEX CONCURRENTLY for live tables and say when it does not apply.
Output format:
1. Summary: top 3 changes
2. Table per recommended index: CREATE INDEX statement, target query, why it helps, trade-offs (write cost, size, maintenance)
3. Redundant or risky existing indexes, with reason
4. Verification plan: EXPLAIN checks before/after and what to monitor
5. Missing info that would change the advice

How to use

  1. Copy the prompt template.
  2. Replace the placeholders in square brackets with your details.
  3. Run it in ChatGPT, Claude or another AI tool.

FAQ

What does this prompt help with?

Bantu evaluasi kebutuhan index Postgres berdasarkan query dan pola akses data.

Can I edit it?

Yes. Copy it and adjust it to your workflow.

Get new Coding prompts every week

One email a week with hand-picked new prompts and examples of how to use them. Free, no spam.

Unsubscribe anytime. We never share your email.

Tools that fit this prompt

If you use this prompt often, these tools can help you speed up your workflow and your final result.

Some links below are affiliate links. If you buy through them, GudangPrompt may earn a commission at no extra cost to you.

Related prompts