From c8e363cd5b7f8ac899cf95e5267eeb1a7b245960 Mon Sep 17 00:00:00 2001 From: Ant Zucaro Date: Sat, 19 Nov 2011 21:54:54 -0500 Subject: [PATCH] Add stripped_nick and indexes for it. --- tables/player_game_stats.tab | 31 +++++++++++++++++++++++++++++++ tables/players.tab | 2 ++ 2 files changed, 33 insertions(+) diff --git a/tables/player_game_stats.tab b/tables/player_game_stats.tab index c6988b2..d32b0aa 100644 --- a/tables/player_game_stats.tab +++ b/tables/player_game_stats.tab @@ -4,6 +4,7 @@ CREATE TABLE xonstat.player_game_stats player_id integer NOT NULL, game_id bigint NOT NULL, nick character varying(128), + stripped_nick character varying(128), team integer, "rank" integer, alivetime interval, @@ -35,59 +36,89 @@ CREATE TABLE xonstat.player_game_stats WITH ( OIDS=FALSE ); + CREATE INDEX player_game_stats_ix01 on player_game_stats(create_dt); +CREATE INDEX player_game_stats_ix02 on player_game_stats(upper(stripped_nick)); ALTER TABLE xonstat.player_game_stats OWNER TO xonstat; + CREATE TABLE xonstat.player_game_stats_2011Q2 ( CHECK ( create_dt >= DATE '2011-04-01' AND create_dt < DATE '2011-07-01' ) ) INHERITS (player_game_stats); + CREATE INDEX player_game_stats_2011Q2_ix01 on player_game_stats_2011Q2(create_dt); +CREATE INDEX pgstats_2011Q2_ix02 on player_game_stats_2011Q2(upper(stripped_nick)); ALTER TABLE xonstat.player_game_stats_2011Q2 OWNER TO xonstat; + CREATE TABLE xonstat.player_game_stats_2011Q3 ( CHECK ( create_dt >= DATE '2011-07-01' AND create_dt < DATE '2011-10-01' ) ) INHERITS (player_game_stats); + CREATE INDEX player_game_stats_2011Q3_ix01 on player_game_stats_2011Q3(create_dt); +CREATE INDEX pgstats_2011Q3_ix02 on player_game_stats_2011Q3(upper(stripped_nick)); ALTER TABLE xonstat.player_game_stats_2011Q3 OWNER TO xonstat; + CREATE TABLE xonstat.player_game_stats_2011Q4 ( CHECK ( create_dt >= DATE '2011-10-01' AND create_dt < DATE '2012-01-01' ) ) INHERITS (player_game_stats); + CREATE INDEX player_game_stats_2011Q4_ix01 on player_game_stats_2011Q4(create_dt); +CREATE INDEX pgstats_2011Q4_ix02 on player_game_stats_2011Q4(upper(stripped_nick)); ALTER TABLE xonstat.player_game_stats_2011Q4 OWNER TO xonstat; + CREATE TABLE xonstat.player_game_stats_2012Q1 ( CHECK ( create_dt >= DATE '2012-01-01' AND create_dt < DATE '2012-04-01' ) ) INHERITS (player_game_stats); + CREATE INDEX player_game_stats_2012Q1_ix01 on player_game_stats_2012Q1(create_dt); +CREATE INDEX pgstats_2012Q1_ix02 on player_game_stats_2012Q1(upper(stripped_nick)); ALTER TABLE xonstat.player_game_stats_2012Q1 OWNER TO xonstat; + CREATE TABLE xonstat.player_game_stats_2012Q2 ( CHECK ( create_dt >= DATE '2012-04-01' AND create_dt < DATE '2012-07-01' ) ) INHERITS (player_game_stats); + CREATE INDEX player_game_stats_2012Q2_ix01 on player_game_stats_2012Q2(create_dt); +CREATE INDEX pgstats_2012Q2_ix02 on player_game_stats_2012Q2(upper(stripped_nick)); ALTER TABLE xonstat.player_game_stats_2012Q2 OWNER TO xonstat; + CREATE TABLE xonstat.player_game_stats_2012Q3 ( CHECK ( create_dt >= DATE '2012-07-01' AND create_dt < DATE '2012-10-01' ) ) INHERITS (player_game_stats); + CREATE INDEX player_game_stats_2012Q3_ix01 on player_game_stats_2012Q3(create_dt); +CREATE INDEX pgstats_2012Q3_ix02 on player_game_stats_2012Q3(upper(stripped_nick)); ALTER TABLE xonstat.player_game_stats_2012Q3 OWNER TO xonstat; + CREATE TABLE xonstat.player_game_stats_2012Q4 ( CHECK ( create_dt >= DATE '2012-10-01' AND create_dt < DATE '2013-01-01' ) ) INHERITS (player_game_stats); + CREATE INDEX player_game_stats_2012Q4_ix01 on player_game_stats_2012Q4(create_dt); +CREATE INDEX pgstats_2012Q4_ix02 on player_game_stats_2012Q4(upper(stripped_nick)); ALTER TABLE xonstat.player_game_stats_2012Q4 OWNER TO xonstat; + CREATE TABLE xonstat.player_game_stats_2013Q1 ( CHECK ( create_dt >= DATE '2013-01-01' AND create_dt < DATE '2013-04-01' ) ) INHERITS (player_game_stats); + CREATE INDEX player_game_stats_2013Q1_ix01 on player_game_stats_2013Q1(create_dt); +CREATE INDEX pgstats_2013Q1_ix02 on player_game_stats_2013Q1(upper(stripped_nick)); ALTER TABLE xonstat.player_game_stats_2013Q1 OWNER TO xonstat; + CREATE TABLE xonstat.player_game_stats_2013Q2 ( CHECK ( create_dt >= DATE '2013-04-01' AND create_dt < DATE '2013-07-01' ) ) INHERITS (player_game_stats); + CREATE INDEX player_game_stats_2013Q2_ix01 on player_game_stats_2013Q2(create_dt); +CREATE INDEX pgstats_2013Q2_ix02 on player_game_stats_2013Q2(upper(stripped_nick)); ALTER TABLE xonstat.player_game_stats_2013Q2 OWNER TO xonstat; + diff --git a/tables/players.tab b/tables/players.tab index b75a53a..db38ce4 100644 --- a/tables/players.tab +++ b/tables/players.tab @@ -11,3 +11,5 @@ WITH ( OIDS=FALSE ); ALTER TABLE xonstat.players OWNER TO xonstat; + +CREATE INDEX players_ix01 ON players ((upper(stripped_nick)); -- 2.39.2