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

Don't archive anything in Goals unless a goal is configured or ecommerce is used #18283

Closed
tsteur opened this issue Nov 9, 2021 · 2 comments · Fixed by #18354
Closed

Don't archive anything in Goals unless a goal is configured or ecommerce is used #18283

tsteur opened this issue Nov 9, 2021 · 2 comments · Fixed by #18354
Assignees
Labels
c: Performance For when we could improve the performance / speed of Matomo.
Milestone

Comments

@tsteur
Copy link
Member

tsteur commented Nov 9, 2021

I noticed that 2/3rd of sites use neither goals nor ecommerce feature.

This means the goals archiver wouldn't need to archive anything when there is no goal and no ecommerce configured for a site.

If we didn't archive in that case, this would be especially useful because in the Goals archiver, we process two dependent archives for new visitors and returning visitors in click and in click. This can be quite slow because it means for every segment (including the All Visits segments), we need to archive two additional segments. This means we need to create two additional temporary tables for the segment to get this data and it can be quite slow to resolve these segment queries. Not doing this can greatly improve archiving overall.

I've prepared a rough fix in https://github.com/matomo-org/matomo/compare/improvegoalarchive?expand=1 but noticed many tests are now failing (see click) because they don't have the ecommerce feature enabled but were tracking ecommerce data nonetheless.

The goal of this issue would be to check if the so far implemented logic makes sense and make the tests work. If tests aren't easy fixable or if there is any issue then we could otherwise also think about only skipping the processDependentArchive in the Goals\Archiver when there is no goal and no ecommerce enabled.

Eg in the tests some fixtures would probably need to be updated that they no longer return data. In some other tests we'd want the ecommerce feature enabled for a site. This way we can test some sites where the archiver skips it and some sites where it's enabled.

The only downside to this is, once you create a goal or enable ecommerce, it will try to archive the data for the entire year for "processDependentArchive" when the yearly archive is being requested. That should be fine though I suppose. Any thoughts on this?

@tsteur tsteur added the c: Performance For when we could improve the performance / speed of Matomo. label Nov 9, 2021
@tsteur tsteur added this to the 4.7.0 milestone Nov 9, 2021
@sgiehl
Copy link
Member

sgiehl commented Nov 9, 2021

@tsteur sound good. Alternatively we could adjust the archiver to not fire any queries if there aren't any goals and simply insert null records. That way there might not be any rearchiving if a goal is created later

@tsteur
Copy link
Member Author

tsteur commented Nov 9, 2021

Insert null records could work 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Performance For when we could improve the performance / speed of Matomo.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants