Skip to content

Profiler and process list

Two tools for the question "why is this slow?" — one looks at a query, the other at the server.

Query profiler

Click Profiler in the toolbar. If a SQL editor tab is active, its query is carried over — otherwise choose the connection and database and paste one in. NabuSQL executes EXPLAIN (ANALYZE) FORMAT=JSON and renders the plan as a tree.

Each node shows the table it touches and its cost, and nodes are weighted against the most expensive one — so the part of the query doing the damage is visually obvious rather than buried in a table of numbers. Attached conditions are shown on the node they apply to.

Built around MySQL's plan format

The profiler parses MySQL's EXPLAIN FORMAT=JSON output. On MySQL and MariaDB you get the full tree. Other engines produce a different plan shape — use F6 (Explain) in the SQL editor there, which shows whatever the server returns.

Reading a plan

Things worth looking for:

  • A full table scan on a large table where you expected an index lookup.
  • A cost that is concentrated in one node — that is where to optimise first.
  • An index that exists but is not used, usually because the WHERE clause wraps the column in a function or compares it against a different type.

After adding an index in Tables and columns, re-run the profiler to confirm the plan actually changed. An index that the planner ignores costs you writes and buys nothing.

Process list

Right-click a database and choose Process List to see what the server is doing right now: the connected sessions, the queries they are running and how long they have been running.

Kill terminates a session. That is the tool for a runaway query holding locks that the rest of the application is waiting on.

Killing a session rolls it back

An interrupted transaction is rolled back by the server, which on a long-running write can take as long as the statement itself. Check what the session is doing before you kill it.

A practical order

  1. The application is slow → Process list: is one query blocking everything?
  2. A specific query is slow → Profiler: where does its cost sit?
  3. Fix — index, rewritten WHERE, different join order.
  4. Re-run the profiler and confirm the plan changed.