System prompts for AI-powered query optimization suggestions.
Summary
Functions
Parse the AI response into a list of suggestion maps.
Generate system prompt for query optimization analysis.
Build the user prompt containing the SQL and execution plan.
Functions
Parse the AI response into a list of suggestion maps.
Returns a list of validated suggestion maps or an empty list if parsing fails.
Generate system prompt for query optimization analysis.
Parameters
database_type- Database type (e.g., :postgres, :mysql, :sqlite)
Build the user prompt containing the SQL and execution plan.
Parameters
sql- The SQL query to optimizeexecution_plan- The execution plan string (from EXPLAIN)schema_context- Optional schema context string