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
Optimize summary queries #1479
Optimize summary queries #1479
Conversation
I have tested mariadb, mysql, pgsql and oracle |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @cproensa nice work !
Just a quick code review for now, will test later on.
98ab574
to
754ff62
Compare
The query for issues time stats is based on bug history, and history queries are expensive when scanning a lot of issues. The previous query retrieves all individual times for each issue, and then processes all the rows to find the maximum, average, etc. This processing, for a big number of issues, adds a considerable time to the function execution. With this change: - Introduce a database api check to know if window functions (analytic) are supported by current database. - When window functions are availabe, perform a query that computes the aggregated values by itself. The result is now only one row. - When window functions are not available, perform the simple, non aggregated query as before. The time cost for the windowed query is very similar to the previous version, but it improves: - No postprocessing time. - By returning one row, it can be effectively cached by the database, and further reduce times in succesive page loads.
Summary queries for bug history are the most expensive queries. Rewrite the queries for open/resolve count to be performed in a single query.
754ff62
to
0abb605
Compare
@cproensa Do you have an issue in the bugtracker for this ? |
Opened #25693 to track this. |
Further improvements for summary page performance, targeting queries that use bug history table.
To put the recent changes of summary page in perspective:
my locally measured times, in a summary page for 50k issues.
MariaDB 10.3
Fixes #25693