]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1183492: Optimize the SQL query for get_enterable_products()
authorMatt Tyson <mtyson@redhat.com>
Tue, 28 Jul 2015 16:28:13 +0000 (18:28 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Tue, 28 Jul 2015 16:28:13 +0000 (18:28 +0200)
r=LpSolit a=sgreen

Bugzilla/User.pm

index 8df1316c53a060fd943e128a126faa59b06071a9..d6c1f122566b51f0f9883f69d509c94ac6f6e598 100644 (file)
@@ -1431,10 +1431,10 @@ sub get_enterable_products {
               WHERE ' . $dbh->sql_in('products.id', $enterable_ids) .
               ' AND products.id IN (SELECT DISTINCT components.product_id
                                       FROM components
-                                     WHERE components.isactive = 1)
+                                     WHERE components.isactive = 1 AND products.id = components.product_id)
                 AND products.id IN (SELECT DISTINCT versions.product_id
                                       FROM versions
-                                     WHERE versions.isactive = 1)');
+                                     WHERE versions.isactive = 1 AND products.id = versions.product_id)');
     }
 
     $self->{enterable_products} =