logo

Pages


Erick’s Games

Faith

Older Games

Other Blogs

Posts

Categories

 

August 2008
S M T W T F S
« Jul    
 12
3456789
10111213141516
17181920212223
24252627282930
31  



Comments

Administration

Why is the word EXPLAIN in front of every MySQL query in SHOW PROCESSLIST?

July 4, 2008

So, I do a SHOW PROCESSLIST command in phpMyAdmin, and it shows a ton of SELECT statements that have EXPLAIN in front of every one of them!  Now, I never even heard of the EXPLAIN keyword, so I certainly didn’t do it.

It took me a couple hours to figure out, but PHP was putting it there.  I had turned mysql.trace_mode = On because the comments said it would give me warnings to table/index scans.  It did give me a couple warnings where I didn’t call mysql_free_result(), so I was happy with it.  But apparently it also added EXPLAIN to all SELECT statements in order to get some data out of that.  Well, I don’t want to slow down the database, so I turned that off.  Good to know it’s there I guess, and exactly what it does.

Google