Faster segmented suggested values when browser archiving is disabled #15732
Labels
c: Performance
For when we could improve the performance / speed of Matomo.
Milestone
We can also do this as part of 3.13.6 if needed.
We're getting the feedback around slow segment suggested values a lot and it can potentially even take down Matomo when it needs to look at a lot of data over 60 days. I'm meaning the
API.getSuggestedValuesForSegment
method.We would like the ability that for some segments to optionally define an API method (eg
Events.getAction
).We'll need to make sure to have tests for both ways for this API method. Initially we would probably not set this for visitor segments but action segments were possible (page urls, page titles, events, ...). Could set it for some visitor segments though as well.
Ideally, we would not need to do range archives eg
period=range&date=last2months
. Looking at one full month be fine. However, we can't really look at previous month since then recent values would be missing and we can't look at the current month because we might be only a few days into the month.last 2 years
as it would be slower to aggregate since year archives usually have a lot more data.From a technical point of view:
The idea is, that a
Dimension
class would be able to define an API method egprotected $segmentSuggestedValuesApi = 'Actions.getPageUrls'
. This would be automatically passed on to the segment class and in theAPI.getSuggestedValuesForSegment
we can then check if browser archiving is disabled and if there is an API defined, then we issue the API request instead of a live query.We would also specify all needed parameters like the
filter_limit=X, filter_offset=0, segment = ''
inRequest::processRequest
.As a side effect, should range period be disabled, this would make the suggested values still work for the months from Feb-Dec. Jan wouldn't work. We need to make sure to have a check for this like
to prevent any exception.
The text was updated successfully, but these errors were encountered: