Database load caused by monitoring plugin

Hello.
Monitoring plugin have a very strange code, that inserts messages into database.
It select count of all messages from database with query: SELECT COUNT(*) FROM ofMessageArchive
Next, this number increased by 1, and inserted into database as “messageID” field.
This code generates heavy load on database with huge number of archived messages and online users.
For example - for me, query executes 3-4 seconds (SSD, MSSQL, 75 millions messages stored).
Database can have autoincrement field, that works much faster.

Yes, that’s not optimal. I’ve raised https://issues.igniterealtime.org/browse/OF-1622 though it may not be fixed any time soon.

Greg

Thanks, i’ve already fixed it for our environment, but i think that fix should be implemented for all supported databases.
Will wait :slight_smile:

1 Like