martedì 10 maggio 2011

phpMyAdmin vs MySql console

Say one day(Is It Friday Yet?) you feel lazy and yet you have to optimize some sql queries that are a bit slow.

Typically that means you have to go find the mysql.exe, find the right parameters to give it, remember the username and password for the root(don't use the root user :P ). Finally you run an explain query and you get this


The HORROR, you can't resize horizontally only verically and the rows are collapsed. Before you try and think about a linux shell, stop and think about the benefits of WAMP(e.g. XamppEasyPhp).

They all install phpMyAdmin for you. So you just type in your query and click the explain button (on the right of the page under the textarea)



In optimizing this ugly query by eliminating the where ... in i also had to add some indexes. Again avoid the console and just use the nice GUI.


i highlighted the index i just added

So to optimize use your favourite book(if you have one) or just read a tutorial.

Finally you should get this beauty :)
 



have fun and KISS

Nessun commento:

Posta un commento