Bugzilla::Bug->vote_count should be its own subroutine

RESOLVED FIXED in Bugzilla 3.0

Status

()

Bugzilla
Creating/Changing Bugs
--
enhancement
RESOLVED FIXED
13 years ago
12 years ago

People

(Reporter: Max Kanat-Alexander, Assigned: Max Kanat-Alexander)

Tracking

2.21
Bugzilla 3.0
Bug Flags:
approval +

Details

Attachments

(1 attachment, 1 obsolete attachment)

v2
2.90 KB, patch
Frédéric Buclin
: review+
Details | Diff | Splinter Review
(Assignee)

Description

13 years ago
We have a GROUP BY statement in Bugzilla::Bug::new that is *only* for the purpose of getting the vote count. Instead, we could easily have a special vote_count accessor function that got that data, and then we could eliminate a join, a group by, and the COALESCE(SUM) that's in Bugzilla::Bug::new.
(Assignee)

Comment 1

12 years ago
LpSolit--this should block your "trim down Bugzilla::Bug->new" bug, but I can't find the bug number.

Updated

12 years ago
Blocks: 341933
(Assignee)

Updated

12 years ago
Assignee: create-and-change → mkanat
(Assignee)

Comment 2

12 years ago
Created attachment 233386 [details] [diff] [review]
v1

Okay, here it is. Easy enough. I checked, and this alone handles it.
Attachment #233386 - Flags: review?(LpSolit)

Comment 3

12 years ago
Comment on attachment 233386 [details] [diff] [review]
v1

You don't need GROUP BY anymore. There are no more agregation functions.
Attachment #233386 - Flags: review?(LpSolit) → review-
(Assignee)

Comment 4

12 years ago
Created attachment 233492 [details] [diff] [review]
v2

Okay. I removed the GROUP BY. It goes away in a later patch (that I've already posted) anyway, but nothing wrong with getting rid of it here.
Attachment #233386 - Attachment is obsolete: true
Attachment #233492 - Flags: review?(LpSolit)

Comment 5

12 years ago
Comment on attachment 233492 [details] [diff] [review]
v2

Tested on both MySQL and Pg. r=LpSolit
Attachment #233492 - Flags: review?(LpSolit) → review+

Updated

12 years ago
Status: NEW → ASSIGNED
Flags: approval?
Flags: approval? → approval+
(Assignee)

Comment 6

12 years ago
Checking in Bugzilla/Bug.pm;
/cvsroot/mozilla/webtools/bugzilla/Bugzilla/Bug.pm,v  <--  Bug.pm
new revision: 1.133; previous revision: 1.132
done
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.