SQL Query Optimizer
By Mr Tech King · Published · Updated
Optimize slow SQL queries and get suggestions for better indexing and performance.
Tags: sql, database, performance
Prompt template
## Introduction Improve the execution speed of your SQL queries. ## Database Information - Database Engine: [dropdown: PostgreSQL, MySQL, SQL Server, SQLite, Oracle] - Query Type: [dropdown: SELECT, INSERT, UPDATE, DELETE, Complex JOIN] ## The Query - Paste your SQL Query: [textarea: Paste the slow query here] ## Context & Performance - Approximate number of rows in main table: [1000, 100000000] - Describe the table schema/indexes: [textarea: Briefly describe the relevant tables and current indexes] - Main bottlenecks to check: [multi: Missing Indexes, Subqueries, JOIN optimization, N+1 problem] ## Output Preferences - Explain the execution plan changes? [toggle: Yes, No] --- **Goal**: Provide an optimized version of the query with a detailed explanation of why it is faster.