forked from lix-project/hydra
hydra-server: set a limit on builds and buildoutputs search
This patch adds a limit statement for Postgresql queries on `builds` and `buildsoutputs` tables.
This commit is contained in:
parent
2b4658b6ea
commit
cb1fce21ba
|
@ -423,11 +423,15 @@ sub search :Local Args(0) {
|
||||||
# Perform build search in separate queries to prevent seq scan on buildoutputs table.
|
# Perform build search in separate queries to prevent seq scan on buildoutputs table.
|
||||||
$c->stash->{builds} = [ $c->model('DB::Builds')->search(
|
$c->stash->{builds} = [ $c->model('DB::Builds')->search(
|
||||||
{ "buildoutputs.path" => { ilike => "%$query%" } },
|
{ "buildoutputs.path" => { ilike => "%$query%" } },
|
||||||
{ order_by => ["id desc"], join => ["buildoutputs"] } ) ];
|
{ order_by => ["id desc"], join => ["buildoutputs"]
|
||||||
|
, rows => $c->stash->{limit}
|
||||||
|
} ) ];
|
||||||
|
|
||||||
$c->stash->{buildsdrv} = [ $c->model('DB::Builds')->search(
|
$c->stash->{buildsdrv} = [ $c->model('DB::Builds')->search(
|
||||||
{ "drvpath" => { ilike => "%$query%" } },
|
{ "drvpath" => { ilike => "%$query%" } },
|
||||||
{ order_by => ["id desc"] } ) ];
|
{ order_by => ["id desc"]
|
||||||
|
, rows => $c->stash->{limit}
|
||||||
|
} ) ];
|
||||||
|
|
||||||
$c->stash->{resource} = { projects => $c->stash->{projects},
|
$c->stash->{resource} = { projects => $c->stash->{projects},
|
||||||
jobsets => $c->stash->{jobsets},
|
jobsets => $c->stash->{jobsets},
|
||||||
|
|
Loading…
Reference in a new issue