diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2013-01-16 19:05:22 +0100 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2013-01-16 19:05:22 +0100 |
commit | d8643908a7d6243c361e670573af763067db408d (patch) | |
tree | b8e5b5df199351e6455843fc27a4c4e1e30433d9 /whine.pl | |
parent | 7b6b9a789a2bfc5707ba1eb85ad7ba5245af64a3 (diff) | |
download | bugzilla-d8643908a7d6243c361e670573af763067db408d.tar.gz bugzilla-d8643908a7d6243c361e670573af763067db408d.tar.xz |
Bug 819432: Execute queries in two steps to improve performance
r=dkl a=LpSolit
Diffstat (limited to 'whine.pl')
-rwxr-xr-x | whine.pl | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -453,7 +453,7 @@ sub run_queries { 'order' => \@orderstrings ); # If a query fails for whatever reason, it shouldn't kill the script. - my $sqlquery = eval { $search->sql }; + my $data = eval { $search->data }; if ($@) { print STDERR get_text('whine_query_failed', { query_name => $thisquery->{'name'}, author => $args->{'author'}, @@ -461,15 +461,12 @@ sub run_queries { next; } - $sth = $dbh->prepare($sqlquery); - $sth->execute; - - while (my @row = $sth->fetchrow_array) { + foreach my $row (@$data) { my $bug = {}; for my $field (@searchfields) { my $fieldname = $field; $fieldname =~ s/^bugs\.//; # No need for bugs.whatever - $bug->{$fieldname} = shift @row; + $bug->{$fieldname} = shift @$row; } if ($thisquery->{'onemailperbug'}) { |