-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add desc indexes to optimize desc query
- Loading branch information
1 parent
55bf514
commit 52f1ba7
Showing
3 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
modules/db/src/main/resources/db/migration/V0009__add_desc_index.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
-- Add desc indexes for players | ||
CREATE INDEX players_name_desc_idx ON players(name DESC NULLS LAST); | ||
CREATE INDEX players_standard_desc_idx ON players(standard DESC NULLS LAST); | ||
CREATE INDEX players_rapid_desc_idx ON players(rapid DESC NULLS LAST); | ||
CREATE INDEX players_blitz_desc_idx ON players(blitz DESC NULLS LAST); | ||
|
||
-- Add desc indexes for federations_summary | ||
CREATE INDEX fed_sum_avg_rating_desc_idx ON federations_summary(avg_rating DESC NULLS LAST); | ||
CREATE INDEX fed_sum_avg_standard_desc_idx ON federations_summary(avg_standard DESC NULLS LAST); | ||
CREATE INDEX fed_sum_avg_rapid_desc_idx ON federations_summary(avg_rapid DESC NULLS LAST); | ||
CREATE INDEX fed_sum_avg_blitz_desc_idx ON federations_summary(avg_blitz DESC NULLS LAST); | ||
CREATE INDEX fed_sum_avg_top_standard_desc_idx ON federations_summary(avg_top_standard DESC NULLS LAST); | ||
CREATE INDEX fed_sum_avg_top_rapid_desc_idx ON federations_summary(avg_top_rapid DESC NULLS LAST); | ||
CREATE INDEX fed_sum_avg_top_blitz_desc_idx ON federations_summary(avg_top_blitz DESC NULLS LAST); | ||
CREATE INDEX fed_sum_avg_top_standard_rank_desc_idx ON federations_summary(avg_top_standard_rank DESC NULLS LAST); | ||
CREATE INDEX fed_sum_avg_top_rapid_rank_desc_idx ON federations_summary(avg_top_rapid_rank DESC NULLS LAST); | ||
CREATE INDEX fed_sum_avg_top_blitz_rank_desc_idx ON federations_summary(avg_top_blitz_rank DESC NULLS LAST); | ||
CREATE INDEX fed_sum_standard_players_desc_idx ON federations_summary(standard_players DESC NULLS LAST); | ||
CREATE INDEX fed_sum_rapid_players_desc_idx ON federations_summary(rapid_players DESC NULLS LAST); | ||
CREATE INDEX fed_sum_blitz_players_desc_idx ON federations_summary(blitz_players DESC NULLS LAST); | ||
CREATE INDEX fed_sum_players_desc_idx ON federations_summary(players DESC NULLS LAST); |