Fix /admin/jobs failing to load due to statement timeout
The `ORDER BY created_at DESC` clause causes a sequential scan because there is no index on the `created_at` column. We can sort by `id` or by `updated_at` to make things fast. Closes #49767
This commit is contained in:
parent
cb2e07309b
commit
00709a13a4
|
@ -2,7 +2,7 @@ class Admin::JobsController < Admin::ApplicationController
|
|||
def index
|
||||
@scope = params[:scope]
|
||||
@all_builds = Ci::Build
|
||||
@builds = @all_builds.order('created_at DESC')
|
||||
@builds = @all_builds.order('id DESC')
|
||||
@builds =
|
||||
case @scope
|
||||
when 'pending'
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: Fix /admin/jobs failing to load due to statement timeout
|
||||
merge_request: 20909
|
||||
author:
|
||||
type: performance
|
Loading…
Reference in New Issue