-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
c: DocumentationFor issues related to in-app product help messages, or to the Matomo knowledge base.For issues related to in-app product help messages, or to the Matomo knowledge base.not-in-changelogFor issues or pull requests that should not be included in our release changelog on matomo.org.For issues or pull requests that should not be included in our release changelog on matomo.org.
Milestone
Description
@diosmosis just looking at some DB performance insights where a lot of new options are showing up in the top queries.
Then looked where they are used and wasn't really understanding what they do and whether they even need to be cached in an option.
- What does the last invalidation time do in https://github.com/matomo-org/matomo/blob/4.x-dev/core/CronArchive.php#L1026-L1035 ? I see it's used in segment archiving in https://github.com/matomo-org/matomo/blob/4.x-dev/core/CronArchive/SegmentArchiving.php#L157-L166 but I don't understand why it compares those dates etc.
- Also maybe the transient cache here is not needed as maybe the Option class itself caches it already? https://github.com/matomo-org/matomo/blob/4.x-dev/core/CronArchive.php#L1026-L1032
- Seeing also this min visit time for site option in https://github.com/matomo-org/matomo/blob/4.x-dev/core/ArchiveProcessor/Loader.php#L427-L442 . Not sure why this one is needed in https://github.com/matomo-org/matomo/blob/4.x-dev/core/ArchiveProcessor/Loader.php#L413-L422 and how that logic works?
- Like we could just query the
$this->rawLogDao->hasSiteVisitsBetweenTimeframe
directly to see if there's been any visit during the archive date range? - And maybe we wouldn't need to use the lazy cache in https://github.com/matomo-org/matomo/blob/4.x-dev/core/ArchiveProcessor/Loader.php#L429-L433 I wonder? (it should be fast)
- I understand we get the min recorded visit time for a site and if the end date was before the min visit time, then we don't execute the
hasSiteVisitsBetweenTimeframe
but not sure when that actually happens and whether we can't just executehasSiteVisitsBetweenTimeframe
directly? Eg because it's a lazy cache it causes even a lot of inserts in server file sync when caches need to be cleared across servers etc and overall it might cause more problems caching it in this case than fetching it from DB directly I wonder.
- Like we could just query the
Might be good to see if we can make some tweaks or remove some code and also maybe add some inline comments explaining what happens as I tried to understand it and wasn't sure what's happening there.
Metadata
Metadata
Assignees
Labels
c: DocumentationFor issues related to in-app product help messages, or to the Matomo knowledge base.For issues related to in-app product help messages, or to the Matomo knowledge base.not-in-changelogFor issues or pull requests that should not be included in our release changelog on matomo.org.For issues or pull requests that should not be included in our release changelog on matomo.org.