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
specify index hint for queryConversionsByPageView to optimize LogAggregator Performance #21701
base: 4.x-dev
Are you sure you want to change the base?
Conversation
…ance Currently the LogAggregator might be *very* slow in large environments of with millions of visitors each day. This mainly comes back to one sql query, which lacks of proper index hints. Settings this optimized the performance from over two weeks per execution, to like 0.9 seconds.
@Fabian123333 thank you for opening the PR. As you created the PR from 4.x branch, can you please confirm that it is not an issue on 5.x or it doesn't apply there or anything like that? |
Could you also provide more information on the system you experienced the speed up on, e.g. was it MariaDb or MySQL server? What versions? It would help us replicate/confirm the performance increase. Thanks! |
On the 5.x branch the DataAccess has been refactored, offering a separat addJoinPrefixHintToQuery method to support Index hints in the DbHelper Class: This uses JOIN_PREFIX, fully supported by MySQL 8, but breaks compatibility with MariaDB versions (as
The performance benefits have been measured on MariaDB 10.5 (build version 10.5.21-MariaDB-0+deb11u1). The produced queries looked as follows:
Resulting in a runtime of 0.909sec, compared to like 14 days of runtime without the optimizer hints. |
This issue is in "needs review" but there has been no activity for 7 days. ping @matomo-org/core-reviewers |
This issue is in "needs review" but there has been no activity for 7 days. ping @matomo-org/core-reviewers |
This issue is in "needs review" but there has been no activity for 7 days. ping @matomo-org/core-reviewers |
This PR was last updated more than one month ago, maybe it's time to close it. Please check if there is anything we still can do or close this PR. ping @matomo-org/core-reviewers |
Description:
Currently the LogAggregator might be very slow in large environments of with millions of visitors each day. This mainly comes back to one sql query, which lacks of proper index hints. Settings this optimized the performance from over two weeks per execution, to like 0.9 seconds.
Review
=> INDEX ist supported by MySQL + MariaDB and available for all supported version. The variant used in Matomo 5.0 dev branchs DBHelper (JOIN_PREFIX) would break on mariadb systems.