Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

if things are slow, check EXPLAIN first.


Which strangely seemed to be one of the last things this guy did, mysql explain and profile are usually enough to see what is going on.


Good advice. "Explain" in this case wouldn't be enough to work out what's going on, however. In both the TEXT and VARCHAR cases he expected the queries to be using temporary tables so the output from mysql explain (both showing the use of temporary tables but not the storage medium such as disk or memory) would not have helped.


Plus I kind of enjoyed the round about way he explained it.


EXPLAIN provides a bit of the clue but the meat of the problem is that the VARCHAR is being changed to a CHAR. EXPLAIN is just verifies that something is going on to force a temp table to be created.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: