Skip to content

Optimize APEL summaries performance (Fixes BUGZ-3893)

Andrii Salnikov requested to merge andrii/arc:optimize-apel-summaries into master

This code change significantly improves the APEL summary query performance without altering the schema. On my mide-side database it manage to reduce the query time from 10 minutes to 2 seconds!

Problem in short:

the APEL summary query requires grouping by benchmark. The benchmark is in the extra attributes table according to our schema, so JOIN is needed. JOIN as it is harms performance more and more when the database grows in size and especially affects sites that have large amount of jobs.

Changes in this MR:

as APEL summary query aggregates the last 2 month only, we can select a subset of data from extra table as well. In the proposed approach the JOIN will be done with a subquery result instead of full extra attributes table. The subquery selects the data from records id range (defined by one more very fast query). This results in a significantly smaller JOIN that runs much faster.

Edited by Maiken

Merge request reports