๐Ÿ’ป
ClaudeCoding & Dev

SQL Query Optimizer

Free

1,339 uses

Optimize slow SQL queries for better database performance.

Prompt

Optimize the following SQL query that is running slowly on a [PostgreSQL/MySQL/SQL Server] database:

```sql
[paste your slow query here]
```

Table sizes: [table1: X rows], [table2: Y rows]. Current execution time: [X seconds]. Analyze: query execution plan issues, missing indexes, N+1 problem, unnecessary subqueries, JOIN optimization opportunities. Provide: optimized query, index recommendations (CREATE INDEX statements), explanation of changes, and expected performance improvement.

Paste directly into Claude ยท Replace text in [brackets] with your own info

Free template suggestion

Suggest a free prompt template we should add

If this prompt is close but not exactly what you need, leave a topic suggestion. We use repeated requests to expand the free prompt library.

  • โ€ข Suggest a missing prompt, checklist, or template topic
  • โ€ข Help us prioritize practical free resources
  • โ€ข Optional email update when related free pages are added

Best for readers who want the free library to cover a specific workflow or niche.

#SQL#query optimization#database performance#indexing

Before you use this prompt

Quick checklist for safer, cleaner AI output

This free prompt is a starting point, not a finished deliverable. Review the result, remove sensitive information, and adapt the wording before you publish, send, or rely on it.

โœ“ Replace every bracketed placeholder with your own context before running it.

โœ“ Remove private customer data, passwords, personal addresses, and unpublished business details.

โœ“ Check facts, numbers, claims, and links before publishing or sending the output.

โœ“ Edit the tone so it matches your brand, audience, and local market.

โœ“ Do not present AI output as legal, medical, financial, or guaranteed professional advice.

โœ“ Save the best version so you can reuse and improve it next time.

โœจ

Try It Out

Enter your topic โ€” AI fills the prompt and shows a live sample

๐Ÿ’ฌ Community Results

See what others created with this prompt

๐ŸŒฑ

No results yet โ€” be the first to share!

Explore related templates

More free prompts for coding & dev

View the full Coding & Dev hub โ†’

If this prompt is useful, the fastest next step is to open a few related templates, compare the wording, and keep the version that best matches your workflow.

AdSense slot placeholder โ€” prompt detail bottom