From bf80e88e6c419d46d3c485df9ec1035e99c47d2c Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Wed, 6 Dec 2023 10:32:49 +0000 Subject: [PATCH] Remove prefetch for heatmap pin fetching. The prefetch used in the sidebar queries is not needed when fetching the pin data. --- perllib/FixMyStreet/App/Controller/Dashboard.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/perllib/FixMyStreet/App/Controller/Dashboard.pm b/perllib/FixMyStreet/App/Controller/Dashboard.pm index c3cb07f6074..7405f28c10c 100644 --- a/perllib/FixMyStreet/App/Controller/Dashboard.pm +++ b/perllib/FixMyStreet/App/Controller/Dashboard.pm @@ -409,7 +409,9 @@ sub heatmap : Local : Args(0) { my $parameters = $c->forward( '/reports/load_problems_parameters'); my $where = $parameters->{where}; + # Filter includes order_by, rows, and a prefetch entry my $filter = $parameters->{filter}; + # We don't need the rows, as we always want all reports delete $filter->{rows}; $c->forward('heatmap_filters', [ $where ]); @@ -423,6 +425,9 @@ sub heatmap : Local : Args(0) { if ($c->get_param('ajax')) { my @pins; + # We don't need any of the prefetched stuff now + delete $filter->{prefetch}; + my $problems = $c->cobrand->problems->to_body($body)->search($where, $filter); while ( my $problem = $problems->next ) { push @pins, $problem->pin_data('reports'); }