Answer the question
In order to leave comments, you need to log in
Is it possible to somehow speed up copying more than 13 thousand records from one database to another on yii2?
The point is to get data from the oracle database and transfer it to the muskl database. Well, the surname can sometimes change, so it's overwritten. I did not find a direct import tool, so I built it into yii. It turned out something like that. But it takes 5-7 minutes to import php (26 thousand requests). Is it possible to speed up the import or is 5-7 minutes a normal speed for 26 thousand requests? (In the future, the number of requests will grow to 30k)
public function actionImport()
{
$oracleUsers = TUSER::find()->all();
foreach ($oracleUsers as $oracleUser)
{
if (Users::findOne(['login' => $oracleUser->CEH_K.$oracleUser->TAB_N, 'password' => $oracleUser->NUMBPROPUSK]))
{
$updatemysqlUsers = Users::findOne(['login' => $oracleUser->CEH_K.$oracleUser->TAB_N, 'password' => $oracleUser->NUMBPROPUSK]);
$updatemysqlUsers->fio = $oracleUser->FIO;
$updatemysqlUsers->save();
}
else
{
$mysqlUsers = new Users();
$mysqlUsers->fio = $oracleUser->FIO;
$mysqlUsers->login = $oracleUser->CEH_K.$oracleUser->TAB_N;
$mysqlUsers->password = $oracleUser->NUMBPROPUSK;
$mysqlUsers->save();
}
}
return $this->render('import');
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question