@tsteur opened this Issue on August 26th 2019 Member

Currently, when we archive, we initialize the PluginsArchiver twice. Once for core and once for the plugins here: https://github.com/matomo-org/matomo/blob/3.12.0-b2/core/ArchiveProcessor/Loader.php#L101-L117

In the PluginsArchiver's constructor we then first cleanup any possible temp table that already exists ( https://github.com/matomo-org/matomo/blob/3.12.0-b2/core/ArchiveProcessor/PluginsArchiver.php#L70-L71) and then later create the temp table as soon as a LogAggregator::generateQuery is called.

This means what we do is:

  • Start archiving core metrics
  • Cleanup temp table for segment if for some reason was not removed (eg a fatal error or memory issue etc and old MySQL version is used)
  • Create temp table for segment
  • archive core metrics
  • Finalise archive
  • Cleanup temp table for segment ===> This is the step we want to prevent but only if we actually go into the plugins archiver again to archive plugin metrics

  • Start archiving plugins metrics
  • Cleanup temp table for segment if for some reason was not removed (eg a fatal error or memory issue etc and old MySQL version is used) ===> This is the step we want to prevent
  • archive plugin metrics
  • Finalise archive
  • Cleanup temp table for segment

This will make segmenting again a bit faster as we avoid running the expensive segment query and avoid lots of inserts...

This Issue was closed on September 10th 2019
Powered by GitHub Issue Mirror