Reduce size of "mdl_notifications" table in MySQL

Reduce size of "mdl_notifications" table in MySQL

by Andreas Giesen -
Number of replies: 3

We have trouble with the size of a MySQL-database. Naturally I reduced log-data etc. but the biggest table is mdl_notifications with 360MiB 

Now I wonder how to clean that up. Also as default settings are to keep most notifications in Moodle and not send by E-Mail and as these are personal settings on a user-by-user-basis, I wonder if there is a way to reduce the growth of this table preventively. 

We absolutely need to keep the database smaller, as it has a limit and with that amount of notifications it is easily reached.... 

Average of ratings: -
In reply to Andreas Giesen

Re: Reduce size of "mdl_notifications" table in MySQL

by Andreas Giesen -

"Also as default settings are to keep most notifications in Moodle"

This may be misunderstood... It is not about them being kept (indefinitely) but about them being delivered via the internal messaging system by default, resulting in them being stored in the database. 

It seems that hardly anybody actually reads the internal notifications. Whatever does not get delivered by E-Mail, will stay unread. Thus the setting to prune read notifications does not help. 

In reply to Andreas Giesen

Re: Reduce size of "mdl_notifications" table in MySQL

by Jamie Biddulph -
There is an open Tracker issue related to this here which appears to address the issue you're having. - https://tracker.moodle.org/browse/MDL-64400
Average of ratings: Useful (1)
In reply to Jamie Biddulph

Re: Reduce size of "mdl_notifications" table in MySQL

by Andreas Giesen -

Yes, thanks, that may be part of the problem. It mentions a setting "delete unread notifications" that does not catch the ones sent by mail, because those don't get marked "read". I don't even have that setting in 3.5 - was it introduced in 3.6?