Improve Database Backup Speed (#5400)

* Support better indexes for Servatrice

- Prevent searching only on msg for logs
This commit is contained in:
Zach H 2025-01-01 00:28:57 -05:00 committed by GitHub
parent 6e1047032d
commit 99eea3a662
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 26 additions and 6 deletions

View file

@ -1210,6 +1210,11 @@ QList<ServerInfo_ChatMessage> Servatrice_DatabaseInterface::getMessageLogHistory
if (!checkSql())
return results;
if (user.isEmpty() && ipaddress.isEmpty() && gameid.isEmpty() && gamename.isEmpty()) {
// To ensure quick results and minimal lag, require an indexed field
return results;
}
// BUILD QUERY STRING BASED ON PASSED IN VALUES
QString queryString = "SELECT * FROM {prefix}_log WHERE `sender_ip` IS NOT NULL";
if (!user.isEmpty())