Optimized GetWeightedPoints to only update users with records. (#758)

This commit is contained in:
shavit 2019-03-25 09:48:03 +02:00
parent 463b8a857b
commit b1106d7c97

View File

@ -787,8 +787,8 @@ void UpdateAllPoints()
#endif
char sQuery[128];
FormatEx(sQuery, 128, "UPDATE %susers SET points = GetWeightedPoints(auth);",
gS_MySQLPrefix);
FormatEx(sQuery, 128, "UPDATE %susers SET points = GetWeightedPoints(auth) WHERE auth IN (SELECT auth FROM %splayertimes GROUP BY auth);",
gS_MySQLPrefix, gS_MySQLPrefix);
gH_SQL.Query(SQL_UpdateAllPoints_Callback, sQuery);
}