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

Tracker: Faster visitor recognition #7779

Closed
tsteur opened this issue Apr 28, 2015 · 1 comment
Closed

Tracker: Faster visitor recognition #7779

tsteur opened this issue Apr 28, 2015 · 1 comment
Assignees
Labels
c: Performance For when we could improve the performance / speed of Matomo.
Milestone

Comments

@tsteur
Copy link
Member

tsteur commented Apr 28, 2015

As discussed with @quba I think the union here is not needed: https://github.com/piwik/piwik/blob/2.13.0-rc2/core/Tracker/Model.php#L382-L386

Instead we could perform one query first to check if there is a idvisitor = ? and if not execute a second query with config_id = ? AND user_id IS NULL

We noticed on a DB with many log entries that this visitor recognition query is rather slow and this should improve it as in most cases a visitor based on idvisitor should be found. Even if not, it should not be slower that way.

@tsteur tsteur added the c: Performance For when we could improve the performance / speed of Matomo. label Apr 28, 2015
@mattab
Copy link
Member

mattab commented May 1, 2015

+1 changing this would definitely help.

This was also reported in #7454 UNION query in findVisitor() is regularly 100ms+, involves temporary tables and scans

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

No branches or pull requests

2 participants