feat(explain): visualize MySQL tree plans - #2112
Conversation
|
Thanks @sophiathedev. This work has shipped in #2117, which is now merged. Your two commits are included there unchanged, with your authorship intact:
#2117 started as a review of this PR and grew into a rewrite of the whole feature, so rather than ask you to rebase onto a moving target we carried your commits forward. The MySQL TREE and ANALYZE parsing you added is what the docs screenshot on the EXPLAIN page now shows. What changed around your work:
A few things from the review of this PR were fixed on the way in, in case they are useful next time: cost never rendered because every display site required both a startup and a total cost and MySQL only reports the total; the diagram derived each row's Y from that node's own height, so siblings drifted apart; and the parser dropped any continuation line that was not a metrics fragment, which lost node text when a query literal contained a newline. Closing this one in favour of #2117. Thanks again for the contribution. |
Summary
EXPLAIN FORMAT=TREEandEXPLAIN ANALYZEoutput into the existing diagram and tree viewerWhy
Typed MySQL
EXPLAIN ANALYZEstatements were routed to the viewer by #1488, but remained Raw-only because the MySQL parser accepted JSON plans only.Follow-up to #1488.
Safety
Verification
MySQLPlanParserTests,CockroachDBPlanParserTests,ExplainResultRouterTests, andQueryPlanDiagramZoomTestsswift test --package-path Packages/TableProCoreswiftlint lint --strictwith 0 violationsTableProbuild with Xcode 26EXPLAIN ANALYZEqueryThe full app test suite was also attempted, but an existing
MCPBridgeIntegrationTestslocal-server test did not complete. SwiftFormat 0.62.1 stops on the repository's unsupported--ifdefindentoption before formatting.Preview