Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
3 changed files
with
115 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters