From: Rudolf Polzer Date: Sun, 11 Jan 2015 16:04:00 +0000 (+0000) Subject: Create a game_id index, and put the gin(players) index into gen_partitions.shl too... X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fxonstatdb.git;a=commitdiff_plain;h=1ccc5d5a2b8e8c713db0d3971dc8dc86a9cbbf5a Create a game_id index, and put the gin(players) index into gen_partitions.shl too for easier maintenance. --- diff --git a/scripts/gen_partitions.shl b/scripts/gen_partitions.shl index b687eef..47583ae 100755 --- a/scripts/gen_partitions.shl +++ b/scripts/gen_partitions.shl @@ -30,6 +30,13 @@ do printf "CREATE INDEX %s_%s%s_ix001 on %s_%s%s(create_dt);\n" $table $year $qtr $table $year $qtr # conditional indexes that depend on the table + if [[ $table = "games" ]] + then + printf "CREATE INDEX %s_%s%s_ix002 on %s_%s%s using gin(players);\n" $table $year $qtr $table $year $qtr + # TODO(divVerent): This index probably should be a primary key instead. + printf "CREATE INDEX %s_%s%s_ix003 on %s_%s%s(game_id);\n" $table $year $qtr $table $year $qtr + fi + if [[ $table = "player_game_stats" || $table = "player_weapon_stats" ]] then printf "CREATE INDEX %s_%s%s_ix002 on %s_%s%s(game_id);\n" $table $year $qtr $table $year $qtr