Very large mdl_analytics_indicator_calc table

Very large mdl_analytics_indicator_calc table

by Thomas College -
Number of replies: 4

We are currently experiencing an issue were the 'mdl_analytics_indicator_calc' table in our Moodle database has grown to almost half the size of the total database.  The 'mdl_analytics_indicator_calc' table is about 25 GB, and our total Moodle database size is around 65GB.  Most of the growth seems to have happened after we upgraded to Moodle 3.8, but I don't have a record of the size of the table before we upgraded to Moodle 3.8.  Most of the indicators in the table rows seems to be listed as '\core_course\analytics\indicator\no_teacher'.

Is there a setting in Moodle were we can clean up or purge this table?  Or specify how long information in this table is retained?  On my own I haven't been able to find settings that might do this.

Our current environment is Moodle 3.8.1 and SQL Server 2019.

Any help is appreciated.

Thanks

Average of ratings: -
In reply to Thomas College

Re: Very large mdl_analytics_indicator_calc table

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
Can you please create a tracker issue for this? - the analytics_indicator_calc stores calculations for caching purposes, and a task to clean up that table is something that we should definitely implement! I know the Analytics team have thought about this, but I can't see a tracker issue for it yet.

In the meantime it's probably safe for you to manually delete records older than 30 days.
In reply to Dan Marsden

Re: Very large mdl_analytics_indicator_calc table

by Thomas College -
Hi Dan,
Thanks for the reply. I've created MDL-68052. Do you have any insight as to why the table size seems to have increased since upgrading to 3.8? Do the new Analytics features in 3.8 generate more calculations?
Thanks
In reply to Thomas College

Re: Very large mdl_analytics_indicator_calc table

by Dan Marsden -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Plugins guardians Picture of Testers Picture of Translators
it depends how many prediction models you have set up, and which time frame analysis you have them set to.

The new default models in 3.8 do have more indicators - I have some models that have 60 indicators (including a number of custom user indicators based on data imported from outside moodle) on one of the sites I'm working on right now and it's definitely generating a lot of data.
In reply to Dan Marsden

Re: Very large mdl_analytics_indicator_calc table

by Thomas College -

Hi Dan, 

We are currently running what I think are the standard Moodle defaults for models, five all together.  Students at risk of dropping out has the most indicators, at 42.

I think we'll just periodically go in and clear out the mdl_analytics_indicator_calc table to maintain the size of the database.

Thanks for all your help.