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

Improve tracker performance when using custom dimensions (one less update query per tracking request) #17173

Closed
tsteur opened this issue Feb 1, 2021 · 0 comments · Fixed by #17521
Labels
c: Custom Dimensions For issues related to the Custom Dimensions plugin. c: Performance For when we could improve the performance / speed of Matomo.

Comments

@tsteur
Copy link
Member

tsteur commented Feb 1, 2021

Now that custom dimensions is included in core I think we could improve the performance of the tracker and have less updates.

Currently, as soon as a custom dimension is configured for a site, we execute an additional query like UPDATE log_visit SET last_idlink_va = '2222' WHERE idsite = '1' AND idvisit = '3333'.

We could maybe get rid of this extra update query for existing visits if we knew we first insert the action and then update the visit. Then we could in the regular visit update also update the last_idlink_va. Not sure if there would be maybe a reason this wouldn't work and whether we have to update the visit before the action.

For new visits this would not work because we need to have the idvisit to insert the action. This likely makes this quite tricky to implement...

I was thinking we could maybe also get rid of the extra action update but this is not the case because it actually updates the action before this action.

Note: the query is only executed when there are action custom dimensions defined so its impact is limited.

@tsteur tsteur added c: Performance For when we could improve the performance / speed of Matomo. c: Custom Dimensions For issues related to the Custom Dimensions plugin. labels Feb 1, 2021
@tsteur tsteur closed this as completed May 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: Custom Dimensions For issues related to the Custom Dimensions plugin. c: Performance For when we could improve the performance / speed of Matomo.
Projects
None yet
1 participant