I run a minecraft server with an add-on called Log Block which logs all things done on the server, now I am making an "admin" panel there which dives into the database and will count the total number of blocks mined and placed.
But how shall I achieve this, I'm talking about 3 million rows and counting.
Should I make a cron job to run once a day with a count(*) and then save this result, or are there better ways to achieve this?
This is the code I have at this point
$result = mysql_query("SELECT count(id) FROM `lb-world` WHERE type='0' AND data='0'");
$result = mysql_fetch_array($result);