mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Improve Database Backup Speed (#5400)
* Support better indexes for Servatrice - Prevent searching only on msg for logs
This commit is contained in:
parent
6e1047032d
commit
99eea3a662
4 changed files with 26 additions and 6 deletions
|
|
@ -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())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue