Repository navigation
Mullion 2.4.0 — Explain slow queries
Mullion 2.4.0
EXPLAIN in the Watch tab — why a query is slow and how to fix it — plus a fix for "Invalid Host header" on Vue CLI / webpack projects.
Upgrade: Settings → About & updates → Upgrade · brew upgrade mullion · scoop update mullion
Added
- EXPLAIN in the Watch tab: why a query is slow, and how to fix it.
Every query row (in Queries and in a request's timeline) has an
Explain button — prominent on slow, N+1 and duplicate ones. It
reads the database's plan with the site's own PHP, using the
project's.envconnection (MySQL, MariaDB, PostgreSQL, SQLite, SQL
Server), and turns it into plain-language findings with a severity, the
why and a concrete fix: full table scans, no usable index or an index
the planner skips, low selectivity, rows read ≫ rows returned,
filesort / temporary tables / sorts and hashes spilling to disk,
LIKE '%x', functions around indexed columns (whereDate,
LOWER(email)),ORacross columns, string columns compared with
numbers,SELECT *on wide tables,ORDER BY RAND(), deepOFFSET
pagination, correlated subqueries, and N+1 with a guess at the relation
to eager-load (->with('posts')). Where an index helps it suggests one
(equality columns, then a range, then ORDER BY) asCREATE INDEXand a
Laravel migration, both copyable — unless an existing index already
covers it; on SQL Server the optimizer's own missing-index hint is
used. The panel shows the plan (MySQL's classic table, PostgreSQL's
node tree with costs, SQL Server's operators), the tables' indexes and
the raw JSON/XML. Only plans are read: Analyze (SELECT only, on
request) runs the query in a read-only transaction that is rolled back
to measure real rows and time. Auto-explain slow queries (off by
default) explains each distinct slow query once and badges its rows
("full scan", "filesort", "no index"…). Also
mullion watch <site> explain "<sql>" [--bindings '[...]'] [--analyze].
Changed
- The project page's tab bar is one row that scrolls sideways (mouse
wheel too) instead of wrapping onto two lines, and Packages and Git
now sit next to Settings at the end.
Fixed
- "Invalid Host header" on webpack-dev-server projects (Vue CLI /
Vue 2, Create React App, Angular, plain webpack): Mullion's proxy now
sends them alocalhostHost, as it already did for Vite.