Open
Bug 364159
Opened 18 years ago
Updated 11 years ago
Inefficient SQL: Requests all fielddefs multiple times
Categories
(Bugzilla :: Creating/Changing Bugs, defect, P4)
Tracking
()
NEW
People
(Reporter: bugzilla-mozilla, Unassigned)
Details
(Keywords: perf)
The following SQL is called sometimes right after eachother. Also appears multiple times throughout a single show_bug.cgi page load. Note: Related, but not a dupe of bug 364151! SELECT id FROM fielddefs SELECT id,name,description,type,custom,mailhead,sortkey,obsolete,enter_bug FROM fielddefs WHERE id IN (1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,24,25,26,27,28,29,34,42,48,49,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86) ORDER BY sortkey, name Ideally it calls the following just once: SELECT id,name,description,type,custom,mailhead,sortkey,obsolete,enter_bug FROM fielddefs ORDER BY sortkey, name I see above SQL statements called 10 times (meaning 20 queries) right after each other. In total, above statements are called 17 times (34 queries). For the whole SQL log, please see attachment 248929 [details].
Comment 1•18 years ago
|
||
I noticed that one too, when using DBI::ProfileDumper. I think it's not all that slow, though.
Severity: normal → minor
Component: Bugzilla-General → Creating/Changing Bugs
Priority: -- → P4
Comment 2•16 years ago
|
||
I'm pretty sure this comes from field-descs.none.tmpl which is called by most templates. IMO, [% PROCESS global/field-descs.none.tmpl %] should be removed from all templates, and be called only once from either global/header.html.tmpl or from global/initialize.none.tmpl.
Comment 3•16 years ago
|
||
(In reply to comment #2) > I'm pretty sure this comes from field-descs.none.tmpl which is called by most > templates. IMO, [% PROCESS global/field-descs.none.tmpl %] should be removed > from all templates, and be called only once from either global/header.html.tmpl > or from global/initialize.none.tmpl. No, we don't need to remove it from templates. Some templates are called with INCLUDE (and you never know when a template is going to be called that way). The correct solution is not to do the DB call if field_descs has already been populated with the DB stuff.
Comment 4•16 years ago
|
||
(In reply to comment #3) > No, we don't need to remove it from templates. Some templates are called with > INCLUDE This doesn't matter. If you add data to initialize.none.html, this data is available to all templates, including those called by INCLUDE. That's because Bugzilla::Template->new() has: PRE_PROCESS => "global/initialize.none.tmpl".
Comment 5•16 years ago
|
||
(In reply to comment #4) > This doesn't matter. If you add data to initialize.none.html, this data is > available to all templates, including those called by INCLUDE. That's because > Bugzilla::Template->new() has: PRE_PROCESS => "global/initialize.none.tmpl". Yes, but we can't add it there, because during checksetup we sometimes access that template when there is no database, if I recall correctly.
You need to log in
before you can comment on or make changes to this bug.
Description
•