From: Ant Zucaro Date: Sat, 15 Dec 2012 14:44:06 +0000 (-0500) Subject: Add support for summary statistics. X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6442f8af710f3ab589f5f860d3da4a61fef29ed5;p=xonotic%2Fxonstatdb.git Add support for summary statistics. The summary statistics table is very small, and is intended to be populated via cron to avoid any lag in the actual webapp when scanning all of the rows in players, games, and servers. Even caching such a query would yield bad performance during invalidation, so I've opted to make this table be populated with an offline script similar to the one for ranks. --- diff --git a/tables/summary_stats.tab b/tables/summary_stats.tab new file mode 100755 index 0000000..8e20da9 --- /dev/null +++ b/tables/summary_stats.tab @@ -0,0 +1,15 @@ +CREATE TABLE xonstat.summary_stats +( + total_players bigint NOT NULL, + total_servers bigint NOT NULL, + total_games bigint NOT NULL, + total_dm_games bigint NOT NULL, + total_duel_games bigint NOT NULL, + total_ctf_games bigint NOT NULL, + create_dt timestamp without time zone NOT NULL DEFAULT (current_timestamp at time zone 'UTC') +) +WITH ( + OIDS=FALSE +); + +ALTER TABLE xonstat.summary_stats OWNER TO xonstat;