explain_query
Generate and analyze CockroachDB statement plans to optimize SQL queries. Use EXPLAIN or EXPLAIN ANALYZE to review execution details and improve query performance.
Instructions
Return CockroachDB's statement plan for a preparable statement. You can use this information to optimize the query. If you run it with Analyze, it executes the SQL query and generates a statement plan with execution statistics.
Args: query (str): SQL query to explain. analyze (bool): If True, run EXPLAIN ANALYZE.
Returns: A success message or an error message.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
analyze | No | ||
query | Yes |
Input Schema (JSON Schema)
{
"properties": {
"analyze": {
"default": false,
"title": "Analyze",
"type": "boolean"
},
"query": {
"title": "Query",
"type": "string"
}
},
"required": [
"query"
],
"title": "explain_queryArguments",
"type": "object"
}