Merge pull request #616 from TNG-dev:zkldi/issue-606

Add various game specific indexes to optimise more "odd" chart access methods.
This commit is contained in:
zkldi
2021-12-30 21:47:58 +00:00
committed by GitHub
+11 -1
View File
@@ -70,7 +70,6 @@ const staticIndexes: Partial<Record<Databases, Index[]>> = {
),
index({ "data.hashSHA256": 1 }),
],
"charts-bms": [index({ "data.hashMD5": 1 }, UNIQUE), index({ "data.hashSHA256": 1 }, UNIQUE)],
"bms-course-lookup": [index({ md5sums: 1 }, UNIQUE)],
"api-tokens": [index({ token: 1 }, UNIQUE), index({ userID: 1 })],
tables: [index({ tableID: 1, game: 1, playtype: 1 }, UNIQUE)],
@@ -85,7 +84,18 @@ const staticIndexes: Partial<Record<Databases, Index[]>> = {
counters: [index({ counterName: 1 }, UNIQUE)],
"class-achievements": [index({ game: 1, playtype: 1, timeAchieved: 1 })],
"api-clients": [index({ clientID: 1 }, UNIQUE)],
"charts-bms": [index({ "data.hashMD5": 1 }, UNIQUE), index({ "data.hashSHA256": 1 }, UNIQUE)],
"charts-popn": [index({ "data.hashSHA256": 1 }, UNIQUE)],
"charts-sdvx": [index({ "data.inGameID": 1 }, UNIQUE)],
"charts-maimai": [
index({ "data.inGameID": 1 }, UNIQUE),
index({ "data.inGameStrID": 1 }, UNIQUE),
],
"charts-museca": [index({ "data.inGameID": 1 }, UNIQUE)],
"charts-chunithm": [index({ "data.inGameID": 1 }, UNIQUE)],
"charts-gitadora": [index({ "data.inGameID": 1 }, UNIQUE)],
"charts-wacca": [index({ isHot: 1 })],
"charts-usc": [index({ "data.hashSHA1": 1 }, UNIQUE)],
};
const indexes: Partial<Record<Databases, Index[]>> = staticIndexes;