[MR Analytics] Improve sort performance by adding NULLS LAST to database index
Problem to solve
The Throughput chart on the MR Analytics page loads slowly. @ahegyi pointed out in #243709 (comment 439684522): "The sort is not supported (NULLS LAST
) is missing from the index definition) by the original index on metrics
: https://explain.depesz.com/s/S3fK"
Proposal
We should add NULLS LAST
to the index definition on merge_request_metrics
.