Closed
Bug 453743
Opened 16 years ago
Closed 16 years ago
Decrease the number of calls to the DB about flags when viewing a bug
Categories
(Bugzilla :: Attachments & Requests, enhancement)
Tracking
()
RESOLVED
FIXED
Bugzilla 3.2
People
(Reporter: LpSolit, Assigned: LpSolit)
References
()
Details
(Keywords: perf)
Attachments
(4 files)
2.33 KB,
patch
|
mkanat
:
review+
|
Details | Diff | Splinter Review |
9.51 KB,
patch
|
mkanat
:
review+
|
Details | Diff | Splinter Review |
801 bytes,
patch
|
Details | Diff | Splinter Review | |
768 bytes,
patch
|
Details | Diff | Splinter Review |
When viewing a bug, Bugzilla::Flag->match() is called once per bug flag type (including inactive ones!), and once per attachment (including those which are not patches), which represents a pretty large number of calls, see the URL. With my patch, this number decreases to only two calls per bug!
Attachment #336953 -
Flags: review?(justdave)
Updated•16 years ago
|
Attachment #336953 -
Flags: review+
Comment 1•16 years ago
|
||
Comment on attachment 336953 [details] [diff] [review] patch for 3.2, v1 This is totally fine as a hack for the branch. Upstream, we should add a preload argument or something to get_attachments_by_bug (which should really be using Object::match) and something similar for FlagType or Flag, much like we did for products.
Updated•16 years ago
|
Target Milestone: --- → Bugzilla 3.2
Assignee | ||
Comment 2•16 years ago
|
||
I refactored the code and moved the code to get flag type data into Bugzilla::Flag::_flag_types, which is now called by both $bug->flag_types and $attachment->flag_types. To preload flag type data when calling get_attachments_by_bug(), you have to pass a true value as 2nd argument (I don't want a separate preload() function).
Attachment #337308 -
Flags: review?(mkanat)
Updated•16 years ago
|
Attachment #336953 -
Flags: review?(justdave)
Updated•16 years ago
|
Attachment #337308 -
Flags: review?(mkanat) → review+
Comment 3•16 years ago
|
||
Comment on attachment 337308 [details] [diff] [review] patch for tip, v2 Sure, this is fine. However, I'd like the second argument to be { preload => 1} instead of just "1", for the sake of consistency. Also, it seems like we could be using Bugzilla::Object::match('Bugzilla::Flag', {}) or something here instead of the new _flag_types method, but perhaps for the future.
Updated•16 years ago
|
Flags: approval3.2+
Flags: approval+
Assignee | ||
Comment 4•16 years ago
|
||
tip: Checking in attachment.cgi; /cvsroot/mozilla/webtools/bugzilla/attachment.cgi,v <-- attachment.cgi new revision: 1.147; previous revision: 1.146 done Checking in Bugzilla/Attachment.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Attachment.pm,v <-- Attachment.pm new revision: 1.57; previous revision: 1.56 done Checking in Bugzilla/Bug.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Bug.pm,v <-- Bug.pm new revision: 1.259; previous revision: 1.258 done Checking in Bugzilla/Flag.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Flag.pm,v <-- Flag.pm new revision: 1.98; previous revision: 1.97 done Checking in template/en/default/attachment/edit.html.tmpl; /cvsroot/mozilla/webtools/bugzilla/template/en/default/attachment/edit.html.tmpl,v <-- edit.html.tmpl new revision: 1.53; previous revision: 1.52 done 3.2rc1: Checking in Bugzilla/Bug.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Bug.pm,v <-- Bug.pm new revision: 1.241.2.10; previous revision: 1.241.2.9 done
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 5•16 years ago
|
||
I have to exclude flags related to private attachments you cannot see. Checking in Bugzilla/Attachment.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Attachment.pm,v <-- Attachment.pm new revision: 1.59; previous revision: 1.58 done
Assignee | ||
Comment 6•16 years ago
|
||
Same fix, but for 3.2. Checking in Bugzilla/Bug.pm; /cvsroot/mozilla/webtools/bugzilla/Bugzilla/Bug.pm,v <-- Bug.pm new revision: 1.241.2.11; previous revision: 1.241.2.10 done
Assignee | ||
Updated•16 years ago
|
Attachment #336953 -
Attachment description: patch, v1 → patch for 3.2, v1
Assignee | ||
Updated•16 years ago
|
Attachment #337308 -
Attachment description: patch, v2 → patch for tip, v2
Assignee | ||
Updated•16 years ago
|
Attachment #337569 -
Attachment description: fix bustage → fix bustage on tip
Assignee | ||
Comment 7•16 years ago
|
||
Selenium script needed to prevent error due to comment 5.
Flags: testcase?
Assignee | ||
Updated•12 years ago
|
Flags: testcase?
You need to log in
before you can comment on or make changes to this bug.
Description
•