Skip to content

Explain a query plan with AI

Explain with AI sends one query and its execution plan to your selected model for analysis. Use it to discuss scans, joins, row estimates and possible index changes.

Configure a provider through AI setup before starting. The action is available for supported queries and connections.

  1. Put the query you want to inspect in the SQL editor.
  2. Open the editor’s three-dot menu.
  3. Choose Explain with AI.
  4. Read the plan analysis in chat.
  5. Ask about the plan detail or recommendation you want to investigate.

TableAI starts with plain EXPLAIN. The provider receives the SQL and plan, along with applicable schema and conversation context. Plans can include filter conditions and literal values; review what AI sees.

Chat showing an AI query-plan explanation and the collapsed EXPLAIN context

The answer can offer Run EXPLAIN ANALYZE when the connection supports it. This collects measurements from executing the query, rather than only its estimated plan.

TableAI asks for confirmation before this action and adds a second analysis using the measured plan. See EXPLAIN ANALYZE for database-specific syntax and behavior.

Compare a proposed index or query rewrite with the schema and workload. Use the SQL review checklist before running recommended SQL.

For a broader investigation, follow diagnose performance. For a database-wide report, use AI Database Analysis. If the provider rejects the request, see AI key or model problems.