GeminiSpark

Optimize SQL Query For Performance

When a database query is slow and you need to improve its execution plan.

Prompt

Optimize the following SQL query for better performance. Explain the changes, like index usage, join restructuring, or subquery optimization. Provide the optimized query and expected impact. SQL query: [SQL QUERY] Database: [DATABASE, e.g., PostgreSQL, MySQL]

Fill in these

Swap each placeholder for your own value:

  • [SQL QUERY]
  • [DATABASE]

Pro tips

  • Share the table schemas and existing indexes if known.
  • Specify the database engine to tailor optimizations.

Want to run prompts like this for free?

Try GeminiOmni — a free playground for Gemini-powered chat, images and video.

Try These Prompts Free

Related prompts