Support MySQL/MariaDB 'Optimizer Trace' table feature in debug mode

Xon

Well-known member
Currently, XenForo does an EXPLAIN on queries to fetch the estimated query plan for various database calls. Recent versions of MySQL (and latest development version of MariaDB) support an "optimizer trace" table which contains the last query's actual execution plan. This feature can be enabled/disabled per session via the optimizer_trace session variable, however the enable/disable state appears different between MariaDB & MySQL.

Explain only outputs the estimated execution plan, which can be different if statistics are out of date compared to what the actual optimizer picks when executing the query.

Supporting this feature would give much more accurate debug information for administrators and developers.

Information;
 
Upvote 10
Back
Top Bottom