translate mysql optimization