Closed Bug 179193 Opened 23 years ago Closed 23 years ago

anyexact should use IN, not OR

Categories

(Bugzilla :: Query/Bug List, defect)

2.17
x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Bugzilla 2.18

People

(Reporter: bbaetz, Assigned: bbaetz)

References

Details

(Keywords: perf)

Attachments

(1 file, 1 obsolete file)

mysql optimises |foo IN (a,b,.....)| into a binary search. For OR, it tests each one individually. For the set of 'all duplicates in bugzilla', the difference between the two for 5 runs (of duplicates.cgi, see the patch on bug 176599) is 1min 3 sec vs 8 seconds. OK, this is probably several thousand bugs, but still... I'm going to attach a patch which fixes this. I know that pg barfs when it gets severl thousand things in an IF; if dkl can come up with a ballpark numebr, we can split this into multiple INs.
Attached patch fix (obsolete) — Splinter Review
Comment on attachment 105675 [details] [diff] [review] fix BTW, do I need the if, or can I be guarnateed that this routine will always be called with at least one value in the list?
Comment on attachment 105675 [details] [diff] [review] fix r=gerv, although doesn't $term start off a "", obviating the need for the "else"? Otherwise, looks sane to me. Gerv
Attachment #105675 - Flags: review+
a= justdave
Keywords: perf
Target Milestone: --- → Bugzilla 2.18
gerv: I don't know, hence my question. That code is Fun.... I'll check this in when I wake up
Attached patch take 2Splinter Review
OK, you're right - $term is set to undef before calling. I dropped the else, and also dropped the if, since we skip out earlier earlier if trim($v) eq ''.
Attachment #105675 - Attachment is obsolete: true
Comment on attachment 105720 [details] [diff] [review] take 2 r=gerv. Gerv
Attachment #105720 - Flags: review+
fixed. dkl, if that pg bug isn't fixed in 7.3, then we can split this up as discussed in comment 0
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
QA Contact: matty_is_a_geek → default-qa
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: