From: Ant Zucaro Date: Fri, 24 Aug 2012 13:55:35 +0000 (-0400) Subject: Index game_id and player_id for performance (and badges). X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5ce02617ead18ccd04f0ce47e9bb6fcbb318f51e;p=xonotic%2Fxonstatdb.git Index game_id and player_id for performance (and badges). --- diff --git a/tables/player_game_stats.tab b/tables/player_game_stats.tab old mode 100644 new mode 100755 index ac29f90..e09f351 --- a/tables/player_game_stats.tab +++ b/tables/player_game_stats.tab @@ -38,6 +38,8 @@ WITH ( ); CREATE INDEX player_game_stats_ix01 on player_game_stats(create_dt); +CREATE INDEX player_game_stats_ix02 on player_game_stats(game_id); +CREATE INDEX player_game_stats_ix03 on player_game_stats(player_id); ALTER TABLE xonstat.player_game_stats OWNER TO xonstat; @@ -46,6 +48,8 @@ CREATE TABLE xonstat.player_game_stats_2011Q2 ( ) INHERITS (player_game_stats); CREATE INDEX player_game_stats_2011Q2_ix01 on player_game_stats_2011Q2(create_dt); +CREATE INDEX player_game_stats_2011Q2_ix02 on player_game_stats_2011Q2(game_id); +CREATE INDEX player_game_stats_2011Q2_ix03 on player_game_stats_2011Q2(player_id); ALTER TABLE xonstat.player_game_stats_2011Q2 OWNER TO xonstat; @@ -54,6 +58,8 @@ CREATE TABLE xonstat.player_game_stats_2011Q3 ( ) INHERITS (player_game_stats); CREATE INDEX player_game_stats_2011Q3_ix01 on player_game_stats_2011Q3(create_dt); +CREATE INDEX player_game_stats_2011Q3_ix02 on player_game_stats_2011Q3(game_id); +CREATE INDEX player_game_stats_2011Q3_ix03 on player_game_stats_2011Q3(player_id); ALTER TABLE xonstat.player_game_stats_2011Q3 OWNER TO xonstat; @@ -62,6 +68,8 @@ CREATE TABLE xonstat.player_game_stats_2011Q4 ( ) INHERITS (player_game_stats); CREATE INDEX player_game_stats_2011Q4_ix01 on player_game_stats_2011Q4(create_dt); +CREATE INDEX player_game_stats_2011Q4_ix02 on player_game_stats_2011Q4(game_id); +CREATE INDEX player_game_stats_2011Q4_ix03 on player_game_stats_2011Q4(player_id); ALTER TABLE xonstat.player_game_stats_2011Q4 OWNER TO xonstat; @@ -70,6 +78,8 @@ CREATE TABLE xonstat.player_game_stats_2012Q1 ( ) INHERITS (player_game_stats); CREATE INDEX player_game_stats_2012Q1_ix01 on player_game_stats_2012Q1(create_dt); +CREATE INDEX player_game_stats_2012Q1_ix02 on player_game_stats_2012Q1(game_id); +CREATE INDEX player_game_stats_2012Q1_ix03 on player_game_stats_2012Q1(player_id); ALTER TABLE xonstat.player_game_stats_2012Q1 OWNER TO xonstat; @@ -78,6 +88,8 @@ CREATE TABLE xonstat.player_game_stats_2012Q2 ( ) INHERITS (player_game_stats); CREATE INDEX player_game_stats_2012Q2_ix01 on player_game_stats_2012Q2(create_dt); +CREATE INDEX player_game_stats_2012Q2_ix02 on player_game_stats_2012Q2(game_id); +CREATE INDEX player_game_stats_2012Q2_ix03 on player_game_stats_2012Q2(player_id); ALTER TABLE xonstat.player_game_stats_2012Q2 OWNER TO xonstat; @@ -86,6 +98,8 @@ CREATE TABLE xonstat.player_game_stats_2012Q3 ( ) INHERITS (player_game_stats); CREATE INDEX player_game_stats_2012Q3_ix01 on player_game_stats_2012Q3(create_dt); +CREATE INDEX player_game_stats_2012Q3_ix02 on player_game_stats_2012Q3(game_id); +CREATE INDEX player_game_stats_2012Q3_ix03 on player_game_stats_2012Q3(player_id); ALTER TABLE xonstat.player_game_stats_2012Q3 OWNER TO xonstat; @@ -94,6 +108,8 @@ CREATE TABLE xonstat.player_game_stats_2012Q4 ( ) INHERITS (player_game_stats); CREATE INDEX player_game_stats_2012Q4_ix01 on player_game_stats_2012Q4(create_dt); +CREATE INDEX player_game_stats_2012Q4_ix02 on player_game_stats_2012Q4(game_id); +CREATE INDEX player_game_stats_2012Q4_ix03 on player_game_stats_2012Q4(player_id); ALTER TABLE xonstat.player_game_stats_2012Q4 OWNER TO xonstat; @@ -102,6 +118,8 @@ CREATE TABLE xonstat.player_game_stats_2013Q1 ( ) INHERITS (player_game_stats); CREATE INDEX player_game_stats_2013Q1_ix01 on player_game_stats_2013Q1(create_dt); +CREATE INDEX player_game_stats_2013Q1_ix02 on player_game_stats_2013Q1(game_id); +CREATE INDEX player_game_stats_2013Q1_ix03 on player_game_stats_2013Q1(player_id); ALTER TABLE xonstat.player_game_stats_2013Q1 OWNER TO xonstat; @@ -110,5 +128,7 @@ CREATE TABLE xonstat.player_game_stats_2013Q2 ( ) INHERITS (player_game_stats); CREATE INDEX player_game_stats_2013Q2_ix01 on player_game_stats_2013Q2(create_dt); +CREATE INDEX player_game_stats_2013Q2_ix02 on player_game_stats_2013Q2(game_id); +CREATE INDEX player_game_stats_2013Q2_ix03 on player_game_stats_2013Q2(player_id); ALTER TABLE xonstat.player_game_stats_2013Q2 OWNER TO xonstat; diff --git a/tables/player_weapon_stats.tab b/tables/player_weapon_stats.tab old mode 100644 new mode 100755 index 60954bb..8bef1f5 --- a/tables/player_weapon_stats.tab +++ b/tables/player_weapon_stats.tab @@ -28,59 +28,89 @@ CREATE TABLE xonstat.player_weapon_stats WITH ( OIDS=FALSE ); + CREATE INDEX player_weap_stats_ix01 on player_weapon_stats(create_dt); +CREATE INDEX player_weap_stats_ix02 on player_weapon_stats(game_id); +CREATE INDEX player_weap_stats_ix03 on player_weapon_stats(player_id); ALTER TABLE xonstat.player_weapon_stats OWNER TO xonstat; CREATE TABLE xonstat.player_weapon_stats_2011Q2 ( CHECK ( create_dt >= DATE '2011-04-01' AND create_dt < DATE '2011-07-01' ) ) INHERITS (player_weapon_stats); + CREATE INDEX player_weap_stats_2011Q2_ix01 on player_weapon_stats_2011Q2(create_dt); +CREATE INDEX player_weap_stats_2011Q2_ix02 on player_weapon_stats_2011Q2(game_id); +CREATE INDEX player_weap_stats_2011Q2_ix03 on player_weapon_stats_2011Q2(player_id); ALTER TABLE xonstat.player_weapon_stats_2011Q2 OWNER TO xonstat; CREATE TABLE xonstat.player_weapon_stats_2011Q3 ( CHECK ( create_dt >= DATE '2011-07-01' AND create_dt < DATE '2011-10-01' ) ) INHERITS (player_weapon_stats); + CREATE INDEX player_weap_stats_2011Q3_ix01 on player_weapon_stats_2011Q3(create_dt); +CREATE INDEX player_weap_stats_2011Q3_ix02 on player_weapon_stats_2011Q3(game_id); +CREATE INDEX player_weap_stats_2011Q3_ix03 on player_weapon_stats_2011Q3(player_id); ALTER TABLE xonstat.player_weapon_stats_2011Q3 OWNER TO xonstat; CREATE TABLE xonstat.player_weapon_stats_2011Q4 ( CHECK ( create_dt >= DATE '2011-10-01' AND create_dt < DATE '2012-01-01' ) ) INHERITS (player_weapon_stats); + CREATE INDEX player_weap_stats_2011Q4_ix01 on player_weapon_stats_2011Q4(create_dt); +CREATE INDEX player_weap_stats_2011Q4_ix02 on player_weapon_stats_2011Q4(game_id); +CREATE INDEX player_weap_stats_2011Q4_ix03 on player_weapon_stats_2011Q4(player_id); ALTER TABLE xonstat.player_weapon_stats_2011Q4 OWNER TO xonstat; CREATE TABLE xonstat.player_weapon_stats_2012Q1 ( CHECK ( create_dt >= DATE '2012-01-01' AND create_dt < DATE '2012-04-01' ) ) INHERITS (player_weapon_stats); + CREATE INDEX player_weap_stats_2012Q1_ix01 on player_weapon_stats_2012Q1(create_dt); +CREATE INDEX player_weap_stats_2012Q1_ix02 on player_weapon_stats_2012Q1(game_id); +CREATE INDEX player_weap_stats_2012Q1_ix03 on player_weapon_stats_2012Q1(player_id); ALTER TABLE xonstat.player_weapon_stats_2012Q1 OWNER TO xonstat; CREATE TABLE xonstat.player_weapon_stats_2012Q2 ( CHECK ( create_dt >= DATE '2012-04-01' AND create_dt < DATE '2012-07-01' ) ) INHERITS (player_weapon_stats); + CREATE INDEX player_weap_stats_2012Q2_ix01 on player_weapon_stats_2012Q2(create_dt); +CREATE INDEX player_weap_stats_2012Q2_ix02 on player_weapon_stats_2012Q2(game_id); +CREATE INDEX player_weap_stats_2012Q2_ix03 on player_weapon_stats_2012Q2(player_id); ALTER TABLE xonstat.player_weapon_stats_2012Q2 OWNER TO xonstat; CREATE TABLE xonstat.player_weapon_stats_2012Q3 ( CHECK ( create_dt >= DATE '2012-07-01' AND create_dt < DATE '2012-10-01' ) ) INHERITS (player_weapon_stats); + CREATE INDEX player_weap_stats_2012Q3_ix01 on player_weapon_stats_2012Q3(create_dt); +CREATE INDEX player_weap_stats_2012Q3_ix02 on player_weapon_stats_2012Q3(game_id); +CREATE INDEX player_weap_stats_2012Q3_ix03 on player_weapon_stats_2012Q3(player_id); ALTER TABLE xonstat.player_weapon_stats_2012Q3 OWNER TO xonstat; CREATE TABLE xonstat.player_weapon_stats_2012Q4 ( CHECK ( create_dt >= DATE '2012-10-01' AND create_dt < DATE '2013-01-01' ) ) INHERITS (player_weapon_stats); + CREATE INDEX player_weap_stats_2012Q4_ix01 on player_weapon_stats_2012Q4(create_dt); +CREATE INDEX player_weap_stats_2012Q4_ix02 on player_weapon_stats_2012Q4(game_id); +CREATE INDEX player_weap_stats_2012Q4_ix03 on player_weapon_stats_2012Q4(player_id); ALTER TABLE xonstat.player_weapon_stats_2012Q4 OWNER TO xonstat; CREATE TABLE xonstat.player_weapon_stats_2013Q1 ( CHECK ( create_dt >= DATE '2013-01-01' AND create_dt < DATE '2013-04-01' ) ) INHERITS (player_weapon_stats); + CREATE INDEX player_weap_stats_2013Q1_ix01 on player_weapon_stats_2013Q1(create_dt); +CREATE INDEX player_weap_stats_2013Q1_ix02 on player_weapon_stats_2013Q1(game_id); +CREATE INDEX player_weap_stats_2013Q1_ix03 on player_weapon_stats_2013Q1(player_id); ALTER TABLE xonstat.player_weapon_stats_2013Q1 OWNER TO xonstat; CREATE TABLE xonstat.player_weapon_stats_2013Q2 ( CHECK ( create_dt >= DATE '2013-04-01' AND create_dt < DATE '2013-07-01' ) ) INHERITS (player_weapon_stats); + CREATE INDEX player_weap_stats_2013Q2_ix01 on player_weapon_stats_2013Q2(create_dt); +CREATE INDEX player_weap_stats_2013Q2_ix02 on player_weapon_stats_2013Q2(game_id); +CREATE INDEX player_weap_stats_2013Q2_ix03 on player_weapon_stats_2013Q2(player_id); ALTER TABLE xonstat.player_weapon_stats_2013Q2 OWNER TO xonstat;