Piwik is not using log_* indexes when segments are applied #9073
Labels
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.
As in topic. I'll start with an example from a realtime widget with a simple page scope custom var segment:
This query is used to calculate number of visits and actions in last X minutes.
I think that instead of this query, we could simply run something like that:
In this case Piwik is using idsite and server_time columns which are indexed. In my case the difference is huge, first query takes 45sec and second one a few milliseconds.
Additionally it may also be the case that it's slow also for standard archiving queries that require joining log_link_visit_action table when there's an action-scope segment (like event, custom var, page title, etc.). I think that it's worth investigating.
The text was updated successfully, but these errors were encountered: