You’re in your new job as a database administrator or data engineer and you just got lost trying to figure out what these insane looking queries are supposed to mean and do. Why are there five joins and why is there an ORDER BY used within a subquery before one of the joins even happens? Remember, you were hired for a reason — most likely, that reason also has to do with many convoluted queries that were created and edited over the last decade.
ExplainThe EXPLAIN keyword is used throughout various SQL databases and provides information about how your SQL database executes a query. In MySQL, EXPLAIN can be used in front of a query beginning with SELECT, INSERT, DELETE, REPLACE, and UPDATE. For a simple query, it would look like the following:
No comments:
Post a Comment