11.06.2014, 17:47
Shorter is not the best way. I have several suggestions, which may not be perfect as I'm sure there are more knowledgeable users when it comes to queries. My first suggestion would be to put your database updates on a separate thread. This would then allow your GM to continue working, even if there's a backlog on the database.
My second suggestion would be to create a queue of updates. It would assign all of the queries to an array on your server's memory, then process them 1 by 1 every few seconds. This might take longer to update everything though, but it would prevent lag spikes.
If you can, use 1 query, it is always going to be more efficient and faster.
My second suggestion would be to create a queue of updates. It would assign all of the queries to an array on your server's memory, then process them 1 by 1 every few seconds. This might take longer to update everything though, but it would prevent lag spikes.
If you can, use 1 query, it is always going to be more efficient and faster.