Happy New Year everyone! I want to dedicate this newsletter to a passion topic of mine: I've now been helping teams optimize their slow database queries for years because apps shouldn't be slow - and slow response times result in a bad user experience. And why are those queries slow? It is not because those teams are bad at what they are doing: Understanding which part of a query is slow is just too hard!
I had private tooling for all those years to simplify the EXPLAIN output you get when optimizing a query. But this helped only me and not the thousands of developers constantly struggling to optimize a query. You could say this is a solved problem today as you can ask an AI to help you. But the reality is different: AI will spit out something for simple queries, which may actually be correct sometimes but the recommendations are worthless as soon as queries
get more complex when multiple tables are involved with joins, subqueries etc.
Last year, I dedicated a lot of work to making my custom tooling easier to understand for anyone so that deep database experience is unnecessary. The result is a free graphical service for MySQL to visualize query plans that I now want to share with you:
mysqlexplain.com
There is also an
API
you can use to submit slow queries easily. I've used it to build a
TablePlus plugin
, a
PHP package
and
Laravel integration
. I would also love to offer a VS Code and DataGrip plugin, but I've not yet figured out how to do it.
This project is dedicated to MySQL because it lacked such a tool and I understand why: It was a ton of work handling all the edge cases the EXPLAIN output can have, which you only know when working with it for years. In the past, the
MySQL Workbench
could show graphical EXPLAINs, but it was never updated for MySQL 8 (released more than 6 years ago!). Analyzing a query that used
“new”
features crashed the tool or displayed incorrect results by omitting critical information it didn't understand.
Most databases have fantastic tooling to visualize and optimize slow queries. If you use PostgreSQL, I used and personally recommend these tools:
Go ahead and check out my tool or the ones I recommended. I am happy to receive any feedback! Do you have any suggestions for improvements?