Documentation/DBA modules
Chapter 28

Performance Profiler and SQL Optimizer

#28.1Profiling a statement

Paste or type SQL into SQL to Profile (a sample multi-table join is provided) and press Run Profiler.

The result header shows the Total Cost, and, when the statement was actually executed, the elapsed time in milliseconds and the row count.

The plan table lists every step: Operation · Object · Rows · Cost · % Cost. Each row carries a proportional bar, and the rows are tinted by weightred above 50 % of total cost, amber above 20 %. This makes the expensive step obvious at a glance.

Alongside, an Execution Plan, Cost by Operation bar chart plots the eight most expensive steps, coloured by the same thresholds.

#28.2AI SQL optimisation

Get AI Suggestion sends the statement and its execution plan to the AI provider you configured (chapter 34) and returns a rewritten query in a code block followed by a bullet list of what changed and why.

If no provider is configured, the panel says so and points you at Settings → AI Configuration.

The rewritten SQL is a suggestion. Verify it returns the same rows before using it.