From: David Lawrence Date: Tue, 5 Jul 2011 21:12:45 +0000 (-0400) Subject: Bug 658929 - User autocomplete is very slow when there are lots of users in the profi... X-Git-Tag: bugzilla-4.0.2~26 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04c504d1b40bcd43601f4a85cbe64138a1905d73;p=thirdparty%2Fbugzilla.git Bug 658929 - User autocomplete is very slow when there are lots of users in the profiles table Reverted patch that changed disabledtext = '' to LENGTH(disabledtext) = 0 as gave no real improvement. --- diff --git a/Bugzilla/User.pm b/Bugzilla/User.pm index 4aa05224fb..f81ed2b2f2 100644 --- a/Bugzilla/User.pm +++ b/Bugzilla/User.pm @@ -1243,7 +1243,7 @@ sub match { "AND group_id IN(" . join(', ', (-1, @{$user->visible_groups_inherited})) . ") "; } - $query .= " AND LENGTH(disabledtext) = 0 " if $exclude_disabled; + $query .= " AND disabledtext = '' " if $exclude_disabled; $query .= $dbh->sql_limit($limit) if $limit; # Execute the query, retrieve the results, and make them into @@ -1278,7 +1278,7 @@ sub match { " AND group_id IN(" . join(', ', (-1, @{$user->visible_groups_inherited})) . ") "; } - $query .= " AND LENGTH(disabledtext) = 0 " if $exclude_disabled; + $query .= " AND disabledtext = '' " if $exclude_disabled; $query .= $dbh->sql_limit($limit) if $limit; my $user_ids = $dbh->selectcol_arrayref($query, undef, ($str, $str)); @users = @{Bugzilla::User->new_from_list($user_ids)}; @@ -1696,7 +1696,7 @@ sub get_userlist { "AND group_id IN(" . join(', ', (-1, @{$self->visible_groups_inherited})) . ")"; } - $query .= " WHERE LENGTH(disabledtext) = 0 "; + $query .= " WHERE disabledtext = '' "; $query .= $dbh->sql_group_by('userid', 'login_name, realname'); my $sth = $dbh->prepare($query);