diff options
author | Matthew Somerville <matthew@mysociety.org> | 2020-04-28 15:39:11 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2020-04-28 16:44:02 +0100 |
commit | e1605415077d30c1d5f86017486e74ebc498063a (patch) | |
tree | 6d24b6074f4ee40df0edb4530bc6ce404eb212d9 /perllib/FixMyStreet/App/Controller/Dashboard.pm | |
parent | a0d40e1a354cfd6c53e97a5fc72001091d33a04f (diff) |
Only request needed join data in places.
The export flow and the admin search request more data
from the database than they need, which slows it down.
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Dashboard.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Dashboard.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Dashboard.pm b/perllib/FixMyStreet/App/Controller/Dashboard.pm index 27c8630f0..ad6c9ba98 100644 --- a/perllib/FixMyStreet/App/Controller/Dashboard.pm +++ b/perllib/FixMyStreet/App/Controller/Dashboard.pm @@ -349,7 +349,8 @@ sub export_as_csv : Private { my $csv = $c->stash->{csv} = { objects => $c->stash->{objects_rs}->search_rs({}, { - prefetch => 'comments', + join => 'comments', + '+columns' => ['comments.problem_state', 'comments.state', 'comments.confirmed', 'comments.mark_fixed'], order_by => ['me.confirmed', 'me.id'], cursor_page_size => 1000, }), |