One array problem multiple array arrays may have the same USERID

for example

$data1=[["userId"=>1,"money"=>100],["userId"=>2,"money"=>100]];
$data2=[["userId"=>1,"hit"=>100],["userId"=>3,"hit"=>100]];
$data3=[["userId"=>2,"b"=>100],["userId"=>3,"b"=>100]];

is there a better way to assemble the same data in each array into a piece of data and then insert it into a database? there may be 10W subarrays in a $data. How efficient is it? beg God for an idea.

Php
Mar.06,2021

you have 100000 elements in each data, which is not easy to deal with, and then you may have to eat a lot of memory every time you run more than one data, of the same size, not to mention that PHP, a scripting language, is more efficient, or it is necessary to reduce the number of elements in data, multi-process processing, and other language processing. There is still a big gap between the processing speed of scripting languages and static languages

Menu