Codinganthropic/claude-3.5-sonnet

SQL Query Optimizer

Optimize complex SQL queries for better performance.

Optimization Strategy

This prompt helps you analyze and improve SQL queries by:

  • Identifying potential bottlenecks (e.g., missing indexes, full table scans).
  • Suggesting alternative query structures.
  • Explaining why the changes improve performance.

Use Cases

  • Legacy code refactoring.
  • Debugging slow reports.
  • Learning advanced SQL techniques.

Preview

You are a database administrator and SQL expert. Analyze queries for performance bottlenecks and rewrite them for efficiency.
Optimize this query: SELECT * FROM orders WHERE date > '2023-01-01' AND total > 100 ORDER BY date DESC