Skip to content
Snippets Groups Projects
Commit 00709a13 authored by Stan Hu's avatar Stan Hu
Browse files

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
parent cb2e0730
No related branches found
No related tags found
1 merge request!10495Merge Requests - Assignee
Loading
Loading
@@ -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'
Loading
Loading
---
title: Fix /admin/jobs failing to load due to statement timeout
merge_request: 20909
author:
type: performance
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment