Closed
Bug 731055
Opened 13 years ago
Closed 13 years ago
get_enterable_products() is very slow when a product has many components or versions
Categories
(Bugzilla :: Creating/Changing Bugs, defect)
Tracking
()
RESOLVED
FIXED
Bugzilla 4.2
People
(Reporter: LpSolit, Assigned: LpSolit)
References
(Blocks 1 open bug)
Details
(Keywords: perf)
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
mkanat
:
review+
|
Details | Diff | Splinter Review |
I created one product with 1000 components, which is not so uncommon (think RedHat, who probably has several hundreds of components for some products), and now $user->get_enterable_products() is terribly slow, around 3 seconds on my machine. This method is used by $bug->choices to determine which products to list in the product field in show_bug.cgi, making each bug very slow to load in the web browser.
The culprit is this query:
$enterable_ids = $dbh->selectcol_arrayref(
'SELECT DISTINCT products.id FROM products
INNER JOIN components ON components.product_id = products.id
INNER JOIN versions ON versions.product_id = products.id
WHERE products.id IN (' . join(',', @$enterable_ids) . ')
AND components.isactive = 1
AND versions.isactive = 1');
Assignee | ||
Updated•13 years ago
|
Flags: blocking4.2.1+
Assignee | ||
Comment 1•13 years ago
|
||
It now takes 0.03 second instead of 3 seconds. 100 times faster. :)
Assignee: create-and-change → LpSolit
Status: NEW → ASSIGNED
Attachment #601129 -
Flags: review?(mkanat)
Comment 2•13 years ago
|
||
Comment on attachment 601129 [details] [diff] [review]
patch, v1
Review of attachment 601129 [details] [diff] [review]:
-----------------------------------------------------------------
::: Bugzilla/User.pm
@@ +1036,5 @@
> # And all of these products must have at least one component
> # and one version.
> $enterable_ids = $dbh->selectcol_arrayref(
> + 'SELECT DISTINCT products.id FROM products
> + WHERE products.id IN (' . join(',', @$enterable_ids) . ')
You have to use sql_in here, or Oracle will break.
Attachment #601129 -
Flags: review?(mkanat) → review-
Assignee | ||
Comment 3•13 years ago
|
||
Attachment #601129 -
Attachment is obsolete: true
Attachment #601132 -
Flags: review?(mkanat)
Assignee | ||
Comment 4•13 years ago
|
||
FYI, with this patch, it now takes 4 seconds to load a bug report on my machine instead of 7 seconds. :)
Assignee | ||
Updated•13 years ago
|
Attachment #601132 -
Flags: review?(mkanat) → review?(glob)
Updated•13 years ago
|
Attachment #601132 -
Flags: review?(glob) → review+
Updated•13 years ago
|
Flags: approval4.2+
Flags: approval+
Assignee | ||
Comment 5•13 years ago
|
||
mkanat: do you think that such a perf win could justify a backport to 4.0 despite this branch is now restricted to security fixes only since last week? It's a major performance win, and not just a theoretical edge case. We are talking about several seconds here. But I'm fine with a "no, it's too late" too.
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/trunk/
modified Bugzilla/User.pm
Committed revision 8135.
Committing to: bzr+ssh://lpsolit%40gmail.com@bzr.mozilla.org/bugzilla/4.2/
modified Bugzilla/User.pm
Committed revision 8040.
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Summary: get_enterable_products() is very slow when a product has many components → get_enterable_products() is very slow when a product has many components or versions
Comment 6•13 years ago
|
||
(In reply to Frédéric Buclin from comment #0)
> I created one product with 1000 components, which is not so uncommon (think
> RedHat, who probably has several hundreds of components for some products),
When I left Red Hat over a year ago, Fedora product had 6000+ components and each of the
RHEL products had 3000+ so not uncommon.
dkl
You need to log in
before you can comment on or make changes to this bug.
Description
•