@canuonifeng opened this Issue on September 28th 2022

I deploy matomo in 09.2022, it auto create matomo_archiveblock{year}_{month} and matomo_archivenumeric{year}_{month} tables from 12.2008 , like this:

image

Questions:

  1. Can I drop these tables? Because my matomo is new deployed, never run between 12.2008 ~ 09.2022
  2. How can i set some config to stop generate older archive_block and archive_numeric tables?
  3. If some cron to run drop the older tables?
@bx80 commented on September 29th 2022 Contributor

Hi @canuonifeng, thanks for reaching out.

Normally Matomo will not create archive tables before the date the site was created. You can check your site created data in the site table ts_created column to confirm it isn't set back to 2008 for some reason.
If you have run any manual reports invalidations for dates this range then this could have caused old archives tables to be created.
If for some reason there are any entries in the log_visit table with timestamps from 2008/2009 then this could cause historic archiving.

If you are sure there is no data for this time period then it is probably safe to drop these tables, it might be a good idea to take a database backup first just to be safe.

@heurteph-ei commented on September 30th 2022

@bx80
My Matomo (version 4.0.5 migrated to 4.3.1) has the same symptoms.
It looks like Matomo creates always empty archives from December 2008...

@canuonifeng commented on September 30th 2022

I dropped the older tables, then create tables like this after soon.

image

My Matomo settings like this, if the problem happend with this setting?

image
image

@bx80 commented on October 6th 2022 Contributor

Hi @canuonifeng, thanks for the additional information, this could well be related to the automatic data deletion tasks :+1:

It's currently expected behavior for Matomo to create monthly archives tables for the current year, since the current year totals are generated from the sum of the months in the year, so 2022-01, 2022-02, etc are created to allow this to happen. This process could perhaps be improved so that monthly archives tables are not created prior to the first site creation date.

The creation of archives tables for periods prior to the year in which the first site was created shouldn't be happening, I've assigned this ticket for prioritization so this can be investigated further.

Powered by GitHub Issue Mirror