explain_query
Generate CockroachDB statement plans to optimize SQL queries. Use EXPLAIN or EXPLAIN ANALYZE to analyze query execution and obtain performance statistics for improved database efficiency.
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 |