From 6442f8af710f3ab589f5f860d3da4a61fef29ed5 Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Sat, 15 Dec 2012 09:44:06 -0500 Subject: [PATCH] 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. --- tables/summary_stats.tab | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 tables/summary_stats.tab 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; -- 2.39.2