我正在尝试将旧的 request-tracker 4.0.3 实例更新为 4.4.3。升级甚至适用于 82'319 用户(包括特权 LDAP 用户;ExternalAuth)。
到目前为止一切都很好,但我意识到使用特权用户显示队列的性能非常慢。显示的队列越长,执行时间就越长。我说的是分钟……通过使用 root 用户或具有管理权限的特权用户“做任何事或什么都不做”(从德语翻译),我立即得到了队列。
此外,我发现 mysql 查询会导致执行时间过长。由于根执行不需要 ACL 检查,因此运行速度更快。但我想花这么多时间是不正常的。花了好几个小时才弄明白。
基本上查询(MYSQL EXPLAIN SELECT ...)的区别是:
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra
| SIMPLE| Groups_2| ref| groups1,groups2,groups3| groups1 | 67 | const | 693212 | Using where; Distinct
| SIMPLE | CachedGroupMembers_3 | ref | DisGrouMem,CachedGroupMembers3,cachedgroupmembers1 | DisGrouMem | 12 | rt3.Groups_2.id,const,const | 1 | Using where; Using index; Distinct
我猜Groups表中的 693212 行差不多。具有相同未更新实例的旧(仍在运行)RT 4.0.3 实例运行起来就像一个魅力。
我做错了吗?
顺便说一句,我在数据库升级期间收到了这个警告:
处理 4.3.0 现在插入数据。[6564] [2018 年 8 月 29 日星期三 22:44:51] [警告]:您有 11141 个用户,其“ExternalAuthId”列的值非空。Core RT 不使用此列,因此扩展或本地修改可能会使用它。请将这些用户值迁移到自定义字段或属性,因为此升级将删除这些列。在 ./etc/upgrade/4.3.0/content 第 67 行。 (./etc/upgrade/4.3.0/content:67) [6564] [Wed Aug 29 22:44:51 2018] [警告]:你有256 个用户,“AuthSystem”列的值为非空。Core RT 不使用此列,因此扩展或本地修改可能会使用它。请将这些用户值迁移到自定义字段或属性,因为此升级将删除这些列。在 ./etc/upgrade/4.3.0/content 第 67 行。(。
为了解决这个问题,我没有做任何改变,但由于 LDAP 用户仍然能够登录,我想这不是问题所在。
有人有什么想法吗?
用户:
SELECT DISTINCT main.* FROM Tickets main LEFT JOIN Groups Groups_2 ON ( Groups_2.Domain = 'RT::Ticket-Role' ) AND ( Groups_2.Instance = main.id ) JOIN Queues Queues_1 ON ( Queues_1.id = main.Queue ) LEFT JOIN CachedGroupMembers CachedGroupMembers_3 ON ( CachedGroupMembers_3.Disabled = '0' ) AND ( CachedGroupMembers_3.MemberId = '1296794' ) AND ( CachedGroupMembers_3.GroupId = Groups_2.id ) WHERE ( ( main.Queue IN ('44', '59', '1', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '19', '20', '21', '22', '23', '24', '25', '26', '27', '29', '30', '31', '32', '33', '34', '35', '36', '37', '38', '39', '40', '41', '42', '43', '44', '45', '46', '47', '48', '49', '50', '51', '52', '53', '54', '55', '57', '58', '59', '60', '62', '63', '64', '65', '66', '68', '69', '72', '78', '79', '73', '80', '82', '83', '85', '88', '90', '92', '93', '94', '97', '99', '28', '102', '103', '106', '108', '109') OR ( CachedGroupMembers_3.MemberId IS NOT NULL AND Groups_2.Name = 'Requestor' ) OR ( CachedGroupMembers_3.MemberId IS NOT NULL AND Groups_2.Name = 'Cc' AND main.Queue IN ('77') ) OR ( CachedGroupMembers_3.MemberId IS NOT NULL AND Groups_2.Name = 'AdminCc' ) OR ( main.Owner = '1296794' ) ) ) AND (main.IsMerged IS NULL) AND (main.Status != 'deleted') AND (main.Type = 'ticket') AND (main.Queue = '72' AND ( ( Queues_1.Lifecycle = 'assets' AND ( main.Status = 'new' OR main.Status = 'allocated' OR main.Status = 'in-use' ) ) OR ( Queues_1.Lifecycle = 'default' AND ( main.Status = 'new' OR main.Status = 'open' OR main.Status = 'stalled' ) ) OR ( Queues_1.Lifecycle = 'approvals' AND ( main.Status = 'new' OR main.Status = 'open' OR main.Status = 'stalled' ) ) ) ) ORDER BY main.id ASC LIMIT 50;
11 行(37.49 秒)
根:
SELECT main.* FROM Tickets main JOIN Queues Queues_1 ON ( Queues_1.id = main.Queue ) WHERE (main.IsMerged IS NULL) AND (main.Status != 'deleted') AND (main.Type = 'ticket') AND (main.Queue = '72' AND ( ( Queues_1.Lifecycle = 'default' AND ( main.Status = 'new' OR main.Status = 'open' OR main.Status = 'stalled' ) ) OR ( Queues_1.Lifecycle = 'assets' AND ( main.Status = 'new' OR main.Status = 'allocated' OR main.Status = 'in-use' ) ) OR ( Queues_1.Lifecycle = 'approvals' AND ( main.Status = 'new' OR main.Status = 'open' OR main.Status = 'stalled' ) ) ) ) ORDER BY main.id ASC LIMIT 50;
11 行(0.00 秒)