Commit 35f74cea authored by jake%acutex.net's avatar jake%acutex.net

Bug 63249 - The Bug Counts report was running very slowly due to unneeded…

Bug 63249 - The Bug Counts report was running very slowly due to unneeded fields/joins in the SQL query. Patch by Matthew Tuck <matty@chariot.net.au> r= gerv@mozilla.org, jake@acutex.net
parent 1a7dfa3a
...@@ -268,32 +268,21 @@ FIN ...@@ -268,32 +268,21 @@ FIN
my $query; my $query;
$query = <<FIN; $query = <<FIN;
select select
bugs.bug_id, bugs.assigned_to, bugs.bug_severity, bugs.bug_id,
bugs.bug_status, bugs.product, bugs.bug_status,
assign.login_name, assign.login_name,
report.login_name,
unix_timestamp(date_format(bugs.creation_ts, '%Y-%m-%d %h:%m:%s')) unix_timestamp(date_format(bugs.creation_ts, '%Y-%m-%d %h:%m:%s'))
from bugs, from bugs,
profiles assign, profiles assign
profiles report,
versions projector
where bugs.assigned_to = assign.userid where bugs.assigned_to = assign.userid
and bugs.reporter = report.userid
FIN FIN
if ($FORM{'product'} ne "-All-" ) { if ($FORM{'product'} ne "-All-" ) {
$query .= "and bugs.product=".SqlQuote($FORM{'product'}); $query .= "and bugs.product=".SqlQuote($FORM{'product'});
} }
$query .= <<FIN; $query .= "AND bugs.bug_status IN ('NEW', 'ASSIGNED', 'REOPENED')";
and
(
bugs.bug_status = 'NEW' or
bugs.bug_status = 'ASSIGNED' or
bugs.bug_status = 'REOPENED'
)
FIN
# End build up $query string # End build up $query string
print "<font color=purple><tt>$query</tt></font><p>\n" print "<font color=purple><tt>$query</tt></font><p>\n"
...@@ -318,7 +307,7 @@ FIN ...@@ -318,7 +307,7 @@ FIN
############################# #############################
my $week = 60 * 60 * 24 * 7; my $week = 60 * 60 * 24 * 7;
while (my ($bid, $a, $sev, $st, $prod, $who, $rep, $ts) = FetchSQLData()) { while (my ($bid, $st, $who, $ts) = FetchSQLData()) {
next if (exists $bugs_lookup{$bid}); next if (exists $bugs_lookup{$bid});
$bugs_lookup{$bid} ++; $bugs_lookup{$bid} ++;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment