Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="https://dev.mysql.com/doc/refman/5.5/en/commit.html" rel="nofollow">How to do Transactions in MySQL.</a> </p> <p>In your case you might be interessted in the atomicity and isolation of transactions, meaning that when restarting a game, you want to ensure that before the reset has not fully finished, nobody can fetch any of your intermediate data. Doing the reset inside a transaction will ensure this property*. (* for TRUNCATE see below) </p> <p>You will need InnoDB as your Engine for all tables that are involved in your transactions. MyISAM does not support transactions. </p> <p>Changing large amounts of data inside a transaction can potentially cause high query delays, as transaction use special undo/redo-logs to be able to undo all the things you did in your transaction, if you decide to <code>ROLLBACK</code>. </p> <p>I wouldn't wipe the tables when starting a new game. Instead give your data a <code>game_id</code> and use a new <code>game_id</code> when starting a new game. Space shouldn't really be an issue nowadays. This has the advantage that you will need little to none table <a href="https://dev.mysql.com/doc/refman/5.0/en/lock-tables.html" rel="nofollow">locking</a> when reseting the game. </p> <p>If you must, be sure to use <code>TRUNCATE</code> when clearing out the tables. As far as I know <code>TRUNCATE</code> in MySQL cannot be rolled back, so doing it inside a transaction won't do anything useful. </p> <p>I think PHP/MySQL will perform fine if used correctly, even for larger visitor counts. You can use profiling tools like <a href="http://xdebug.org/" rel="nofollow">xdebug</a> or the <a href="https://dev.mysql.com/doc/refman/5.0/en/slow-query-log.html" rel="nofollow">MySQL slow query log</a> to trace and remove performance bottle necks. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload