Ok I am doing a batch upsert in Laravel and it based on the matching field not being the primary key, however it is unique.
$array_to_insert = [];
foreach ($array as $account) {
$record_array = [];
$record_array['name'] = $account['name'];
$record_array['coingecko_id'] = $account['id'];
$record_array['identifier'] = strtoupper($account['symbol']);
$record_array['current_price'] = $account['current_price'];
$record_array['market_cap'] = $account['market_cap'];
$record_array['market_cap_rank'] = $account['market_cap_rank'];
$record_array['type'] = "cryptocurrency";
array_push($array_to_insert, $record_array);
}
$result = CryptoAccount::upsert($array_to_insert, ['identifier'], ['name','coingecko_id','identifier','current_price','market_cap','market_cap_rank']);
var_dump($result);
It is looking throught about 350 results a time and the auto_increment value is going up by the same even though it is only updating most rows and not inserting them.