Welcome Guest, Not a member yet? Register   Sign In
Update about 1 million rows in MySQL table every 1 hour
#4

By running calculation in SQL, I mean you need to skip your foreach completely and do all math in said SQL instead. Only passing in $currency_numbers_after_dot, $game_currency_percentage_max, $game_currency_speed_in_hour to the query and let it do everything for you.

Batch update are a third option, didn't think of that one. You can find an example on batch update in the user guide. It will be faster as you get 10 000 instead of 1 000 000 queries (per default). But not as fast as running it with one query.
https://codeigniter.com/userguide3/datab...ating-data

As you expect more than 1 000 000 users, you need to plan ahead. As it will just get slower every time.
Reply


Messages In This Thread
RE: Update about 1 million rows in MySQL table every 1 hour - by jreklund - 07-21-2020, 08:35 AM



Theme © iAndrew 2016 - Forum software by © MyBB