Prepared statements are sometimes much slower than unprepared statements, because the planner doesn't have access to the query parameters. This is the case for the active build steps query (in /status), where a prepared statement is three orders of magnitude slower. So disable the use of prepared statements in this case.
(Since the query parameters are constant here, it would be nicer if we could tell DBIx::Class to prepare a statement with those parameters fixed. But I don't know an easy way to do so.)
LGNML7VJCQ4E53ZYRGL5BNK6KVTNQGPJKFIULSAGSTU6VK45INMAC
NZYFWV6MZ4T47TM737C3DWQOBPSEWDWMCY6RZE65T4FPCZNTBLIAC
MOX7XJ2E3XISXA7V7T4W6GEAGECGWBZ4PYSLTYBVVR4VAKOI33CQC
EFWN7JBV7YIHNMCA6ZGFRSHZIUQJ2EX57SWYGVT7ZRJCHPIM2R3QC
J5UVLXOK6EDIL5I7VKWH4V2QDS4DPD7FHRK6XBWSXFRQS4JKXFZQC
6KJXJB7NZ5XJ3WGUWKFNT6LMBNYJN3IPHZ7B7H654D5B6LPOL5QAC
KAZWI5G4DN2WUW7L2KWZR3D3QQJON4ISQYP7CRLC5HAOPIDYQGRQC
LBNVQXUBEZ45SOTGVXK5UEZXIAIZTJLWZNUYFI4JZ6J65N3KPDVQC
LUPEGYR76IIJFCEV6QU3VII2DNOHH3W3RHQI77LDFZU7B5QETTHQC
FPK5LF53CFUEKFYJ3IYXT4UTVC6IITWJOCFATMC4PLHEUP5SIEAAC
FYO6NECE4YJC76HQIG35NNJABODV7KNQKREK5YKZU6O2MNNSQTMAC
7YBYT2LQML2PKEO6UO4444AGSASS664UCDXW2YO3ALB7THQHCEBQC
FHAVPTZ6GYCZMMPIJN2VPGBACK66NENWCFJMTAOW6464WNCJPVOQC
6QRHXIM3XHCDLSIIBEGETDV67V6LTV55QMHC64ZPBMLTAECM5N3QC
E2TOU3L66CH5DA4XPATQM5YM63SFXX63V7SDOIGS4ND3GR7HQALAC
N22GPKYTOLZLBGTGDATQDVZ4R5APZEAOIA7L32X4UXBH4XNI7MWAC
$c->stash->{steps} = [ $c->model('DB::BuildSteps')->search(
{ 'me.busy' => 1, 'build.busy' => 1 },
{ join => [ 'build' ]
, order_by => [ 'machine' ]
} ) ];
$c->model('DB')->storage->dbh_do(sub {
my (undef, $dbh) = @_;
local $dbh->{pg_server_prepare} = 0;
$c->stash->{steps} = [ $c->model('DB::BuildSteps')->search(
{ 'me.busy' => 1, 'build.finished' => 0, 'build.busy' => 1 },
{ join => [ 'build' ]
, order_by => [ 'machine' ]
} ) ];
});