Skip to content

[MR Analytics] Do not sort by columns in different tables when not necessary

Problem to solve

The Throughput table on the MR Analytics page loads slowly. @ahegyi pointed out in #243709 (comment 439684522) that the query currently sorts on columns in both merge_requests and merge_request_metrics, and said: "Sorting by two columns in different tables is inefficient, we should probably use: metrics.merged_at, metrics.id".

Proposal

Adjust the Throughput table query so it sorts using metrics.merged_at and metrics.id.

Edited by Adam Hegyi