Jump to content
MakeWebGames

Recommended Posts

Posted

When it comes to crons, is it better to have one query for each item or one query for multiple items where there is no WHERE clause. 

For example;

$db->query("UPDATE users SET this+1");
$db->query("UPDATE users SET that+1");
$db->query("UPDATE users SET those+1");

OR

$db->query("UPDATE users SET this+1, that+1, those +1");

Would you give some queries priority over others? In the example above (3 queries) would you put them in a different order or does that even matter?

I'm wondering because a lot of times on other games, sometimes the cron will only complete some of the queries rather than all. 

Posted

I wouldn’t think in an application like a web based game it matters all that much. Now if your handling 10s of thousands of transactions at a time, then maybe 1 hit to the database would be easier on your resources and be more efficient. 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...