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

Auto-archiving is slower than it could be #4699

Closed
anonymous-matomo-user opened this issue Feb 17, 2014 · 2 comments
Closed

Auto-archiving is slower than it could be #4699

anonymous-matomo-user opened this issue Feb 17, 2014 · 2 comments
Labels
Bug For errors / faults / flaws / inconsistencies etc. c: Performance For when we could improve the performance / speed of Matomo. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.

Comments

@anonymous-matomo-user
Copy link

I am running the archiving cron job every 5 minutes, but each query uses a 24 hour interval like this one:

...
WHERE
log_link_visit_action.server_time >= '2014-02-16 22:00:00'
AND log_link_visit_action.server_time <= '2014-02-17 21:59:59'
AND log_link_visit_action.idsite = '1'
AND log_link_visit_action.idaction_name IS NOT NULL AND log_link_visit_action.idaction_event_category IS NULL
...

By saving the time when auto-archiving was ran the last time and using that in the queries we can make them up to 10 times faster. My tests show about 0.6 seconds needed for a 2 hour interval and 5 seconds for 24 hours one.
Keywords: sql

@anonymous-matomo-user
Copy link
Author

Ok, after analyzing the way Piwik works it looks like this gives the daily values. But do we really need to rerun the fairly complicated daily query each time the archiving cron job starts?

@mattab
Copy link
Member

mattab commented Feb 17, 2014

Please don't use trac to ask questions about Piwik, use forums: http://forum.piwik.org

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc. c: Performance For when we could improve the performance / speed of Matomo. wontfix If you can reproduce this issue, please reopen the issue or create a new one describing it.
Projects
None yet
Development

No branches or pull requests

2 participants