📝 Prompt

Optimize SQL Query

Analyze and optimize the following SQL query:

Coding 💾 0 saves by PromptChief
Analyze and optimize the following SQL query: ```sql [[SELECTED_TEXT]] ``` **Database:** [[DB_TYPE]] (PostgreSQL / MySQL / SQLite / ...) **Table sizes:** [[SIZES]] Check: 1. Missing or unnecessary indexes 2. Inefficient JOINs or subqueries 3. Avoid SELECT * 4. Query plan analysis (EXPLAIN) 5. Possible alternatives (CTEs, Window Functions, Materialized Views) Show optimized version with justification.
Share 𝕏 in LinkedIn WhatsApp Reddit

Use this prompt in one click

Save it, fill in the [[variables]], and inject it straight into ChatGPT, Claude or Gemini with the free PromptChief extension.

Open in Prompt Hub →

← Browse all prompts