Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
48e96823
Commit
48e96823
authored
Jan 03, 2013
by
Frédéric Buclin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 824262: Querying for strings in comments is now ultra slow
r=glob a=LpSolit
parent
28d94456
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
7 deletions
+18
-7
Search.pm
Bugzilla/Search.pm
+18
-7
No files found.
Bugzilla/Search.pm
View file @
48e96823
...
...
@@ -1915,13 +1915,24 @@ sub _quote_unless_numeric {
sub
build_subselect
{
my
(
$outer
,
$inner
,
$table
,
$cond
,
$negate
)
=
@_
;
# Execute subselects immediately to avoid dependent subqueries, which are
# large performance hits on MySql
my
$q
=
"SELECT DISTINCT $inner FROM $table WHERE $cond"
;
my
$dbh
=
Bugzilla
->
dbh
;
my
$list
=
$dbh
->
selectcol_arrayref
(
$q
);
return
$negate
?
"1=1"
:
"1=2"
unless
@$list
;
return
$dbh
->
sql_in
(
$outer
,
$list
,
$negate
);
if
(
$table
eq
'longdescs'
)
{
# There is no index on the longdescs.thetext column and so it takes
# a long time to scan the whole table unconditionally. For this table,
# we return the subselect and let the DB optimizer restrict the search
# to some given bug list only based on other search criteria available.
my
$not
=
$negate
?
"NOT"
:
""
;
return
"$outer $not IN (SELECT DISTINCT $inner FROM $table WHERE $cond)"
;
}
else
{
# Execute subselects immediately to avoid dependent subqueries, which are
# large performance hits on MySql
my
$q
=
"SELECT DISTINCT $inner FROM $table WHERE $cond"
;
my
$dbh
=
Bugzilla
->
dbh
;
my
$list
=
$dbh
->
selectcol_arrayref
(
$q
);
return
$negate
?
"1=1"
:
"1=2"
unless
@$list
;
return
$dbh
->
sql_in
(
$outer
,
$list
,
$negate
);
}
}
# Used by anyexact to get the list of input values. This allows us to
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment