From b64b7d70038fcf38495f67bc2f9cb320c2c168e7 Mon Sep 17 00:00:00 2001 From: Greg Stark Date: Thu, 11 Jan 2018 13:22:52 +0000 Subject: Use simple Next/Prev paging for jobs to avoid large count queries on arbitrarily large sets of historical jobs --- app/controllers/projects/jobs_controller.rb | 2 +- app/views/projects/jobs/_table.html.haml | 2 +- changelogs/unreleased/disable-pages-on-jobs.yml | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 changelogs/unreleased/disable-pages-on-jobs.yml diff --git a/app/controllers/projects/jobs_controller.rb b/app/controllers/projects/jobs_controller.rb index 4865ec3dfe5..8b54ba3ad7c 100644 --- a/app/controllers/projects/jobs_controller.rb +++ b/app/controllers/projects/jobs_controller.rb @@ -29,7 +29,7 @@ class Projects::JobsController < Projects::ApplicationController :project, :tags ]) - @builds = @builds.page(params[:page]).per(30) + @builds = @builds.page(params[:page]).per(30).without_count end def cancel_all diff --git a/app/views/projects/jobs/_table.html.haml b/app/views/projects/jobs/_table.html.haml index 82806f022ee..d124d3ebfc1 100644 --- a/app/views/projects/jobs/_table.html.haml +++ b/app/views/projects/jobs/_table.html.haml @@ -22,4 +22,4 @@ = render partial: "projects/ci/builds/build", collection: builds, as: :build, locals: { commit_sha: true, ref: true, pipeline_link: true, stage: true, allow_retry: true, admin: admin } - = paginate builds, theme: 'gitlab' + = paginate_collection(builds) diff --git a/changelogs/unreleased/disable-pages-on-jobs.yml b/changelogs/unreleased/disable-pages-on-jobs.yml new file mode 100644 index 00000000000..629768efce1 --- /dev/null +++ b/changelogs/unreleased/disable-pages-on-jobs.yml @@ -0,0 +1,6 @@ +--- +title: Use simple Next/Prev paging for jobs to avoid large count queries on arbitrarily + large sets of historical jobs +merge_request: +author: +type: performance -- cgit v1.2.1