]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Running a query using the Added Comment option was very slow (bug 57350).
authorjake%acutex.net <>
Tue, 19 Jun 2001 09:05:08 +0000 (09:05 +0000)
committerjake%acutex.net <>
Tue, 19 Jun 2001 09:05:08 +0000 (09:05 +0000)
Patch by Myk Melez <myk@mozilla.org> and Dave Miller <justdave@syndicomm.com>
r= jake@acutex.net

buglist.cgi
checksetup.pl

index b99afefe9ca2dcee1e1ec43f25c91eeb915d39d3..206b968ca769f5fec6c8bbab5ef5a6462387060b 100755 (executable)
@@ -241,7 +241,7 @@ sub GenerateSQL {
             push(@wherepart, "$table.bug_id = bugs.bug_id");
             my $ptable = "longdescnames_";
             push(@supptables,
-                 "LEFT JOIN profiles $ptable ON $table.who = $ptable.userid");
+                 "INNER JOIN profiles $ptable ON $table.who = $ptable.userid");
             push(@clist, "$ptable.login_name", $type, $email);
         }
         if (@clist) {
@@ -745,7 +745,7 @@ sub GenerateSQL {
     my $suppstring = "bugs";
     foreach my $str (@supptables) {
         if (!$suppseen{$str}) {
-            if ($str !~ /^LEFT JOIN/i) {
+            if ($str !~ /^(LEFT|INNER) JOIN/i) {
                 $suppstring .= ",";
             }
             $suppstring .= " $str";
index ed90b6f5d897444daaf4b34300f2f4601318d3d6..f8ef65d77674985a1cd8584d190959c90ef2b16e 100755 (executable)
@@ -761,6 +761,7 @@ $table{longdescs} =
     thetext mediumtext,
 
     index(bug_id),
+    index(who),
     index(bug_when)';
 
 
@@ -2184,6 +2185,16 @@ if (-d 'shadow') {
 DropField("profiles", "emailnotification");
 DropField("profiles", "newemailtech");
 
+#
+# 2001-06-06 justdave@syndicomm.com:
+# There was no index on the 'who' column in the long descriptions table.
+# This caused queries by who posted comments to take a LONG time.
+#   http://bugzilla.mozilla.org/show_bug.cgi?id=57350
+if (!defined GetIndexDef('longdescs','who')) {
+    print "Adding index for who column in longdescs table...\n";
+    $dbh->do('ALTER TABLE longdescs ADD INDEX (who)');
+}
+
 # 2001-06-15 kiko@async.com.br - Change bug:version size to avoid
 # truncates re http://bugzilla.mozilla.org/show_bug.cgi?id=9352
 ChangeFieldType('bugs', 'version','varchar(64) not null');