Does mysql really not optimize this?