Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Howto stop auto create older archive_block_{year}_{month} table? #19780

Open
canuonifeng opened this issue Sep 28, 2022 · 4 comments
Open

Howto stop auto create older archive_block_{year}_{month} table? #19780

canuonifeng opened this issue Sep 28, 2022 · 4 comments
Labels
Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced.

Comments

@canuonifeng
Copy link

I deploy matomo in 09.2022, it auto create matomo_archive_block_{year}{month} and matomo_archive_numeric{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?
@canuonifeng canuonifeng added the Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. label Sep 28, 2022
@bx80
Copy link
Contributor

bx80 commented Sep 29, 2022

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.

@bx80 bx80 closed this as completed Sep 29, 2022
@bx80 bx80 added answered For when a question was asked and we referred to forum or answered it. and removed Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. labels Sep 29, 2022
@heurteph-ei
Copy link

@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
Copy link
Author

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 bx80 reopened this Oct 6, 2022
@bx80 bx80 added Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced. and removed answered For when a question was asked and we referred to forum or answered it. labels Oct 6, 2022
@bx80 bx80 added this to the For Prioritization milestone Oct 6, 2022
@bx80
Copy link
Contributor

bx80 commented Oct 6, 2022

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

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Potential Bug Something that might be a bug, but needs validation and confirmation it can be reproduced.
Projects
None yet
Development

No branches or pull requests

3 participants