Support for MyXQL for Explain
vorce opened this issue · 3 comments
vorce commented
First: Not sure how useful the explain is from mysql dbs, and how easy it would be to visualize. Need to start there I think.
Second:
- I attempted to add format=json actually giving back the data encoded from myxql here: elixir-ecto/myxql#159. But it wasn't really doable in a good way.
- Next step might be to at least allow format json in ecto_sql (
Ecto.Adapters.MyXQL.Connection.build_explain_query
), and we can get a string of the json back and encode it ourselves.
vorce commented
Examples of visualizers for explain for myxql:
- The mysql workbench
- https://tailtq.github.io/mysql-explain-visualization/
- https://www.percona.com/blog/2018/03/01/visualize-this-mysql-tools-we-use-to-explain-our-queries/ <- has a nice example json explain output we can use for testing.
so it's definitely worth adding support for myxql to kino_ecto.
vorce commented
My second attempt at adding structured explain output from myxql, this time one level above the adapter where we have more information and can actually decode it: elixir-ecto/ecto_sql#454
Edit: This got merged! So we can get structured output from myxql now.
vorce commented
- MySQL explain format docs: https://dev.mysql.com/doc/refman/5.7/en/explain-output.html
- MariaDB has differences: https://mariadb.com/kb/en/explain-format-json-differences/