From: Matt Tyson Date: Tue, 28 Jul 2015 16:28:13 +0000 (+0200) Subject: Bug 1183492: Optimize the SQL query for get_enterable_products() X-Git-Tag: release-5.1.1~220 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61a971cd65be2eaaa923af0f17a00159cc0e8222;p=thirdparty%2Fbugzilla.git Bug 1183492: Optimize the SQL query for get_enterable_products() r=LpSolit a=sgreen --- diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index 8df1316c53..d6c1f12256 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -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} =