Add date period to segment archive queries #17330
Labels
c: Platform
For Matomo platform changes that aren't impacting any of our APIs but improve the core itself.
Milestone
When there is an archiving query for a segment, then we don't know which time period this query is selecting because the time period was already included in the query when the temporary table was created (https://github.com/matomo-org/matomo/blob/4.2.1/core/DataAccess/LogAggregator.php#L273)
When a segment is used, then we'd basically need to add another comment here including the date: https://github.com/matomo-org/matomo/blob/4.2.1/core/DataAccess/LogAggregator.php#L400
Eg if it queries the day for
2020-02-02
then there be a comment/* 2020-02-02 */
. We wouldn't need to know the exact time range used but could do that if it's easier. We could also generally add this comment and adjust the query hint accordingly around https://github.com/matomo-org/matomo/blob/4.2.1/core/ArchiveProcessor/PluginsArchiver.php#L153If it's easily possible, then we'd also want to add the segmentId (might be already the case)
While working on this could then maybe also quickly look at #17327
Technically this should be already the case but maybe this is not working? https://github.com/matomo-org/matomo/blob/4.2.1/core/DataAccess/LogAggregator.php#L406-L408
We would expect to see something like
SELECT /* 2020-02-02,2020-02-03 sites 1,2,3 */ /* plugin name /* ...
This should only apply to archiver queries when you for example execute
./console core:archive
and it is executing a query of some plugin archiver.The text was updated successfully, but these errors were encountered: