From: Johan De Meersman Date: November 22 2012 11:27am Subject: Re: Query Plan Analyzer List-Archive: http://lists.mysql.com/mysql/228678 Message-Id: <30527734.14629.1353583625636.JavaMail.root@tuxera.be> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit ----- Original Message ----- > From: "Cabbar Duzayak" > > Is there a way of looking at how mysql builds the query plan and > executes it for a given query? EXPLAIN is definitely a useful tool, but it is > not exact (shows approximations as far as I can see), furthermore I want > something like how the predicates were applied (before or after > JOINS), which indexes were used, etc. > > Basically, Oracle's EXPLAIN PLAN and SQL TRACE do this, and it is > very very useful for optimizing queries. Don't get me wrong, I love mysql, but > with mysql, you optimize queries more by trial and error, instead of > understanding what exactly is going on. The Percona Toolset has pt-visual-explain and some other useful tools. There's also SHOW PROFILE in mysql itself, look at http://dev.mysql.com/doc/refman/5.0/en/show-profiles.html for more about that. All in all, though, I'm not sure you can go quite as deep as you can in Oracle. -- Linux Bier Wanderung 2012, now also available in Belgium! August, 12 to 19, Diksmuide, Belgium - http://lbw2012.tuxera.be